Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorThomas Raoux <thomasraoux@google.com>2022-04-07 10:14:39 +0300
committerThomas Raoux <thomasraoux@google.com>2022-04-14 19:33:46 +0300
commit4c564940a14f55d2315d2676b10fea0660ea814a (patch)
tree1649ca4ac4fa7b6bf75a5cd3d85e88da229e6108 /utils
parentf14ebe91c5dd6be5b64a45e479291cd08676be0c (diff)
[mlir][nvgpu] Add NVGPU dialect (architectural specific gpu dialect)
This introduce a new dialect for vendro specific ptx operations. This also adds the first operation ldmatrix as an example. More operations will be added in follow up patches. This new dialect is meant to be a bridge between GPU and Vector dialectis and NVVM dialect. This is based on the RFC proposed here: https://discourse.llvm.org/t/rfc-add-nv-gpu-dialect-hw-specific-extension-of-gpu-dialect-for-nvidia-gpus/61466/8 Differential Revision: https://reviews.llvm.org/D123266
Diffstat (limited to 'utils')
-rw-r--r--utils/bazel/llvm-project-overlay/mlir/BUILD.bazel64
1 files changed, 64 insertions, 0 deletions
diff --git a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
index ee1542933366..656a089082ab 100644
--- a/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/mlir/BUILD.bazel
@@ -1996,6 +1996,69 @@ cc_library(
],
)
+##---------------------------------------------------------------------------##
+# NVGPU dialect.
+##---------------------------------------------------------------------------##
+
+td_library(
+ name = "NVGPUTdFiles",
+ srcs = ["include/mlir/Dialect/NVGPU/NVGPU.td"],
+ includes = ["include"],
+ deps = [
+ ":SideEffectInterfacesTdFiles",
+ ],
+)
+
+gentbl_cc_library(
+ name = "NVGPUIncGen",
+ strip_include_prefix = "include",
+ tbl_outs = [
+ (
+ [
+ "-gen-dialect-decls",
+ "-dialect=nvgpu",
+ ],
+ "include/mlir/Dialect/NVGPU/NVGPUDialect.h.inc",
+ ),
+ (
+ [
+ "-gen-dialect-defs",
+ "-dialect=nvgpu",
+ ],
+ "include/mlir/Dialect/NVGPU/NVGPUDialect.cpp.inc",
+ ),
+ (
+ ["-gen-op-decls"],
+ "include/mlir/Dialect/NVGPU/NVGPU.h.inc",
+ ),
+ (
+ ["-gen-op-defs"],
+ "include/mlir/Dialect/NVGPU/NVGPU.cpp.inc",
+ ),
+ (
+ ["-gen-op-doc"],
+ "g3doc/Dialects/NVGPU/NVGPU.md",
+ ),
+ ],
+ tblgen = ":mlir-tblgen",
+ td_file = "include/mlir/Dialect/NVGPU/NVGPU.td",
+ deps = [":NVGPUTdFiles"],
+)
+
+cc_library(
+ name = "NVGPU",
+ srcs = ["lib/Dialect/NVGPU/IR/NVGPUDialect.cpp"],
+ hdrs = ["include/mlir/Dialect/NVGPU/NVGPUDialect.h"],
+ includes = ["include"],
+ deps = [
+ ":IR",
+ ":NVGPUIncGen",
+ ":SideEffectInterfaces",
+ "//llvm:Core",
+ "//llvm:Support",
+ ],
+)
+
td_library(
name = "FuncTdFiles",
srcs = [
@@ -5985,6 +6048,7 @@ cc_library(
":MemRefToLLVM",
":MemRefToSPIRV",
":MemRefTransforms",
+ ":NVGPU",
":NVVMDialect",
":OpenACCDialect",
":OpenMPDialect",