Skip to content

Commit 95767a9

Browse files
[mlir][nvgpu] separate ops, types, attribute definitions in NVGPU dialect. (#129846)
It is hoped that the Ops, Types, and Attribute of the NVGPU dialect can be defined in separate files.If downstream projects extend NVGPU and define other Ops, the types and attributes will be used.This PR was raised to avoid including the definition of NVGPU Ops.
1 parent 9543e9e commit 95767a9

File tree

8 files changed

+776
-735
lines changed

8 files changed

+776
-735
lines changed
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
add_mlir_dialect(NVGPU nvgpu)
2-
add_mlir_doc(NVGPU NVGPU Dialects/ -gen-dialect-doc)
2+
add_mlir_doc(NVGPUOps NVGPU Dialects/ -gen-dialect-doc)
3+
4+
set(LLVM_TARGET_DEFINITIONS NVGPUOps.td)
5+
mlir_tablegen(NVGPUOps.h.inc -gen-op-decls)
6+
mlir_tablegen(NVGPUOps.cpp.inc -gen-op-defs)
7+
add_public_tablegen_target(MLIRNVGPUOpsIncGen)
38

49
set(LLVM_TARGET_DEFINITIONS NVGPU.td)
510
mlir_tablegen(NVGPUEnums.h.inc -gen-enum-decls)
@@ -11,7 +16,7 @@ mlir_tablegen(NVGPUAttrDefs.h.inc -gen-attrdef-decls)
1116
mlir_tablegen(NVGPUAttrDefs.cpp.inc -gen-attrdef-defs)
1217
add_public_tablegen_target(MLIRNVGPUAttributesIncGen)
1318

14-
set(LLVM_TARGET_DEFINITIONS NVGPU.td)
15-
mlir_tablegen(NVGPUAttrTypes.h.inc -gen-typedef-decls)
16-
mlir_tablegen(NVGPUAttrTypes.cpp.inc -gen-typedef-decls)
19+
set(LLVM_TARGET_DEFINITIONS NVGPUTypes.td)
20+
mlir_tablegen(NVGPUTypeDefs.h.inc -gen-typedef-decls)
21+
mlir_tablegen(NVGPUTypeDefs.cpp.inc -gen-typedef-defs)
1722
add_public_tablegen_target(MLIRNVGPUTypesIncGen)

mlir/include/mlir/Dialect/NVGPU/IR/NVGPU.td

Lines changed: 4 additions & 723 deletions
Large diffs are not rendered by default.

mlir/include/mlir/Dialect/NVGPU/IR/NVGPUDialect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ constexpr unsigned kMaxTMALastdimByte = 128;
5353
#include "mlir/Dialect/NVGPU/IR/NVGPUAttrDefs.h.inc"
5454

5555
#define GET_TYPEDEF_CLASSES
56-
#include "mlir/Dialect/NVGPU/IR/NVGPUTypes.h.inc"
56+
#include "mlir/Dialect/NVGPU/IR/NVGPUTypeDefs.h.inc"
5757

5858
#include "mlir/Dialect/NVGPU/IR/NVGPUDialect.h.inc"
5959

6060
#define GET_OP_CLASSES
61-
#include "mlir/Dialect/NVGPU/IR/NVGPU.h.inc"
61+
#include "mlir/Dialect/NVGPU/IR/NVGPUOps.h.inc"
6262

6363
#endif // MLIR_DIALECT_NVGPU_NVGPUDIALECT_H_

0 commit comments

Comments
 (0)