Skip to content

Commit 2056393

Browse files
committed
Separate the Registration from Loading dialects in the Context
This changes the behavior of constructing MLIRContext to no longer load globally registered dialects on construction. Instead Dialects are only loaded explicitly on demand: - the Parser is lazily loading Dialects in the context as it encounters them during parsing. This is the only purpose for registering dialects and not load them in the context. - Passes are expected to declare the dialects they will create entity from (Operations, Attributes, or Types), and the PassManager is loading Dialects into the Context when starting a pipeline. This changes simplifies the configuration of the registration: a compiler only need to load the dialect for the IR it will emit, and the optimizer is self-contained and load the required Dialects. For example in the Toy tutorial, the compiler only needs to load the Toy dialect in the Context, all the others (linalg, affine, std, LLVM, ...) are automatically loaded depending on the optimization pipeline enabled. Differential Revision: https://reviews.llvm.org/D85622
1 parent ba92dad commit 2056393

File tree

92 files changed

+714
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+714
-216
lines changed

flang/unittests/Lower/OpenMPLoweringTest.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515
class OpenMPLoweringTest : public testing::Test {
1616
protected:
1717
void SetUp() override {
18-
mlir::registerDialect<mlir::omp::OpenMPDialect>();
19-
mlir::registerAllDialects(&ctx);
18+
ctx.loadDialect<mlir::omp::OpenMPDialect>();
2019
mlirOpBuilder.reset(new mlir::OpBuilder(&ctx));
2120
}
2221

mlir/examples/standalone/standalone-opt/standalone-opt.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ int main(int argc, char **argv) {
7676
if (showDialects) {
7777
mlir::MLIRContext context;
7878
llvm::outs() << "Registered Dialects:\n";
79-
for (mlir::Dialect *dialect : context.getRegisteredDialects()) {
79+
for (mlir::Dialect *dialect : context.getLoadedDialects()) {
8080
llvm::outs() << dialect->getNamespace() << "\n";
8181
}
8282
return 0;

mlir/examples/toy/Ch2/toyc.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ std::unique_ptr<toy::ModuleAST> parseInputFile(llvm::StringRef filename) {
6868
}
6969

7070
int dumpMLIR() {
71-
// Register our Dialect with MLIR.
72-
mlir::registerDialect<mlir::toy::ToyDialect>();
73-
74-
mlir::MLIRContext context;
71+
mlir::MLIRContext context(/*loadAllDialects=*/false);
72+
// Load our Dialect in this MLIR Context.
73+
context.getOrLoadDialect<mlir::toy::ToyDialect>();
7574

7675
// Handle '.toy' input to the compiler.
7776
if (inputType != InputType::MLIR &&

mlir/examples/toy/Ch3/toyc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context,
102102
}
103103

104104
int dumpMLIR() {
105-
// Register our Dialect with MLIR.
106-
mlir::registerDialect<mlir::toy::ToyDialect>();
105+
mlir::MLIRContext context(/*loadAllDialects=*/false);
106+
// Load our Dialect in this MLIR Context.
107+
context.getOrLoadDialect<mlir::toy::ToyDialect>();
107108

108-
mlir::MLIRContext context;
109109
mlir::OwningModuleRef module;
110110
llvm::SourceMgr sourceMgr;
111111
mlir::SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context);

mlir/examples/toy/Ch4/toyc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context,
103103
}
104104

105105
int dumpMLIR() {
106-
// Register our Dialect with MLIR.
107-
mlir::registerDialect<mlir::toy::ToyDialect>();
106+
mlir::MLIRContext context(/*loadAllDialects=*/false);
107+
// Load our Dialect in this MLIR Context.
108+
context.getOrLoadDialect<mlir::toy::ToyDialect>();
108109

109-
mlir::MLIRContext context;
110110
mlir::OwningModuleRef module;
111111
llvm::SourceMgr sourceMgr;
112112
mlir::SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context);

mlir/examples/toy/Ch5/mlir/LowerToAffineLoops.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ struct TransposeOpLowering : public ConversionPattern {
256256
namespace {
257257
struct ToyToAffineLoweringPass
258258
: public PassWrapper<ToyToAffineLoweringPass, FunctionPass> {
259+
void getDependentDialects(DialectRegistry &registry) const override {
260+
registry.insert<AffineDialect, StandardOpsDialect>();
261+
}
259262
void runOnFunction() final;
260263
};
261264
} // end anonymous namespace.

mlir/examples/toy/Ch5/toyc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,10 @@ int loadMLIR(llvm::SourceMgr &sourceMgr, mlir::MLIRContext &context,
106106
}
107107

108108
int dumpMLIR() {
109-
// Register our Dialect with MLIR.
110-
mlir::registerDialect<mlir::toy::ToyDialect>();
109+
mlir::MLIRContext context(/*loadAllDialects=*/false);
110+
// Load our Dialect in this MLIR Context.
111+
context.getOrLoadDialect<mlir::toy::ToyDialect>();
111112

112-
mlir::MLIRContext context;
113113
mlir::OwningModuleRef module;
114114
llvm::SourceMgr sourceMgr;
115115
mlir::SourceMgrDiagnosticHandler sourceMgrHandler(sourceMgr, &context);

mlir/examples/toy/Ch6/mlir/LowerToAffineLoops.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ struct TransposeOpLowering : public ConversionPattern {
255255
namespace {
256256
struct ToyToAffineLoweringPass
257257
: public PassWrapper<ToyToAffineLoweringPass, FunctionPass> {
258+
void getDependentDialects(DialectRegistry &registry) const override {
259+
registry.insert<AffineDialect, StandardOpsDialect>();
260+
}
258261
void runOnFunction() final;
259262
};
260263
} // end anonymous namespace.

mlir/examples/toy/Ch6/mlir/LowerToLLVM.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ class PrintOpLowering : public ConversionPattern {
159159
namespace {
160160
struct ToyToLLVMLoweringPass
161161
: public PassWrapper<ToyToLLVMLoweringPass, OperationPass<ModuleOp>> {
162+
void getDependentDialects(DialectRegistry &registry) const override {
163+
registry.insert<LLVM::LLVMDialect, scf::SCFDialect>();
164+
}
162165
void runOnOperation() final;
163166
};
164167
} // end anonymous namespace

mlir/examples/toy/Ch6/toyc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,10 @@ int main(int argc, char **argv) {
255255

256256
// If we aren't dumping the AST, then we are compiling with/to MLIR.
257257

258-
// Register our Dialect with MLIR.
259-
mlir::registerDialect<mlir::toy::ToyDialect>();
258+
mlir::MLIRContext context(/*loadAllDialects=*/false);
259+
// Load our Dialect in this MLIR Context.
260+
context.getOrLoadDialect<mlir::toy::ToyDialect>();
260261

261-
mlir::MLIRContext context;
262262
mlir::OwningModuleRef module;
263263
if (int error = loadAndProcessMLIR(context, module))
264264
return error;

mlir/examples/toy/Ch7/mlir/LowerToAffineLoops.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ struct TransposeOpLowering : public ConversionPattern {
256256
namespace {
257257
struct ToyToAffineLoweringPass
258258
: public PassWrapper<ToyToAffineLoweringPass, FunctionPass> {
259+
void getDependentDialects(DialectRegistry &registry) const override {
260+
registry.insert<AffineDialect, StandardOpsDialect>();
261+
}
259262
void runOnFunction() final;
260263
};
261264
} // end anonymous namespace.

mlir/examples/toy/Ch7/mlir/LowerToLLVM.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ class PrintOpLowering : public ConversionPattern {
159159
namespace {
160160
struct ToyToLLVMLoweringPass
161161
: public PassWrapper<ToyToLLVMLoweringPass, OperationPass<ModuleOp>> {
162+
void getDependentDialects(DialectRegistry &registry) const override {
163+
registry.insert<LLVM::LLVMDialect, scf::SCFDialect>();
164+
}
162165
void runOnOperation() final;
163166
};
164167
} // end anonymous namespace

mlir/examples/toy/Ch7/toyc.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ int main(int argc, char **argv) {
256256

257257
// If we aren't dumping the AST, then we are compiling with/to MLIR.
258258

259-
// Register our Dialect with MLIR.
260-
mlir::registerDialect<mlir::toy::ToyDialect>();
259+
mlir::MLIRContext context(/*loadAllDialects=*/false);
260+
// Load our Dialect in this MLIR Context.
261+
context.getOrLoadDialect<mlir::toy::ToyDialect>();
261262

262-
mlir::MLIRContext context;
263263
mlir::OwningModuleRef module;
264264
if (int error = loadAndProcessMLIR(context, module))
265265
return error;

mlir/include/mlir-c/IR.h

+6
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,12 @@ MlirContext mlirContextCreate();
9090
/** Takes an MLIR context owned by the caller and destroys it. */
9191
void mlirContextDestroy(MlirContext context);
9292

93+
/** Load all the globally registered dialects in the provided context.
94+
* TODO: remove the concept of globally registered dialect by exposing the
95+
* DialectRegistry.
96+
*/
97+
void mlirContextLoadAllDialects(MlirContext context);
98+
9399
/*============================================================================*/
94100
/* Location API. */
95101
/*============================================================================*/

mlir/include/mlir/Conversion/Passes.td

+26
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ def ConvertAffineToStandard : Pass<"lower-affine"> {
6666
`affine.apply`.
6767
}];
6868
let constructor = "mlir::createLowerAffinePass()";
69+
let dependentDialects = [
70+
"scf::SCFDialect",
71+
"StandardOpsDialect",
72+
"vector::VectorDialect"
73+
];
6974
}
7075

7176
//===----------------------------------------------------------------------===//
@@ -76,6 +81,7 @@ def ConvertAVX512ToLLVM : Pass<"convert-avx512-to-llvm", "ModuleOp"> {
7681
let summary = "Convert the operations from the avx512 dialect into the LLVM "
7782
"dialect";
7883
let constructor = "mlir::createConvertAVX512ToLLVMPass()";
84+
let dependentDialects = ["LLVM::LLVMDialect", "LLVM::LLVMAVX512Dialect"];
7985
}
8086

8187
//===----------------------------------------------------------------------===//
@@ -98,6 +104,7 @@ def GpuToLLVMConversionPass : Pass<"gpu-to-llvm", "ModuleOp"> {
98104
def ConvertGpuOpsToNVVMOps : Pass<"convert-gpu-to-nvvm", "gpu::GPUModuleOp"> {
99105
let summary = "Generate NVVM operations for gpu operations";
100106
let constructor = "mlir::createLowerGpuOpsToNVVMOpsPass()";
107+
let dependentDialects = ["NVVM::NVVMDialect"];
101108
let options = [
102109
Option<"indexBitwidth", "index-bitwidth", "unsigned",
103110
/*default=kDeriveIndexBitwidthFromDataLayout*/"0",
@@ -112,6 +119,7 @@ def ConvertGpuOpsToNVVMOps : Pass<"convert-gpu-to-nvvm", "gpu::GPUModuleOp"> {
112119
def ConvertGpuOpsToROCDLOps : Pass<"convert-gpu-to-rocdl", "gpu::GPUModuleOp"> {
113120
let summary = "Generate ROCDL operations for gpu operations";
114121
let constructor = "mlir::createLowerGpuOpsToROCDLOpsPass()";
122+
let dependentDialects = ["ROCDL::ROCDLDialect"];
115123
let options = [
116124
Option<"indexBitwidth", "index-bitwidth", "unsigned",
117125
/*default=kDeriveIndexBitwidthFromDataLayout*/"0",
@@ -126,6 +134,7 @@ def ConvertGpuOpsToROCDLOps : Pass<"convert-gpu-to-rocdl", "gpu::GPUModuleOp"> {
126134
def ConvertGPUToSPIRV : Pass<"convert-gpu-to-spirv", "ModuleOp"> {
127135
let summary = "Convert GPU dialect to SPIR-V dialect";
128136
let constructor = "mlir::createConvertGPUToSPIRVPass()";
137+
let dependentDialects = ["spirv::SPIRVDialect"];
129138
}
130139

131140
//===----------------------------------------------------------------------===//
@@ -136,13 +145,15 @@ def ConvertGpuLaunchFuncToVulkanLaunchFunc
136145
: Pass<"convert-gpu-launch-to-vulkan-launch", "ModuleOp"> {
137146
let summary = "Convert gpu.launch_func to vulkanLaunch external call";
138147
let constructor = "mlir::createConvertGpuLaunchFuncToVulkanLaunchFuncPass()";
148+
let dependentDialects = ["spirv::SPIRVDialect"];
139149
}
140150

141151
def ConvertVulkanLaunchFuncToVulkanCalls
142152
: Pass<"launch-func-to-vulkan", "ModuleOp"> {
143153
let summary = "Convert vulkanLaunch external call to Vulkan runtime external "
144154
"calls";
145155
let constructor = "mlir::createConvertVulkanLaunchFuncToVulkanCallsPass()";
156+
let dependentDialects = ["LLVM::LLVMDialect"];
146157
}
147158

148159
//===----------------------------------------------------------------------===//
@@ -153,6 +164,7 @@ def ConvertLinalgToLLVM : Pass<"convert-linalg-to-llvm", "ModuleOp"> {
153164
let summary = "Convert the operations from the linalg dialect into the LLVM "
154165
"dialect";
155166
let constructor = "mlir::createConvertLinalgToLLVMPass()";
167+
let dependentDialects = ["scf::SCFDialect", "LLVM::LLVMDialect"];
156168
}
157169

158170
//===----------------------------------------------------------------------===//
@@ -163,6 +175,7 @@ def ConvertLinalgToStandard : Pass<"convert-linalg-to-std", "ModuleOp"> {
163175
let summary = "Convert the operations from the linalg dialect into the "
164176
"Standard dialect";
165177
let constructor = "mlir::createConvertLinalgToStandardPass()";
178+
let dependentDialects = ["StandardOpsDialect"];
166179
}
167180

168181
//===----------------------------------------------------------------------===//
@@ -172,6 +185,7 @@ def ConvertLinalgToStandard : Pass<"convert-linalg-to-std", "ModuleOp"> {
172185
def ConvertLinalgToSPIRV : Pass<"convert-linalg-to-spirv", "ModuleOp"> {
173186
let summary = "Convert Linalg ops to SPIR-V ops";
174187
let constructor = "mlir::createLinalgToSPIRVPass()";
188+
let dependentDialects = ["spirv::SPIRVDialect"];
175189
}
176190

177191
//===----------------------------------------------------------------------===//
@@ -182,6 +196,7 @@ def SCFToStandard : Pass<"convert-scf-to-std"> {
182196
let summary = "Convert SCF dialect to Standard dialect, replacing structured"
183197
" control flow with a CFG";
184198
let constructor = "mlir::createLowerToCFGPass()";
199+
let dependentDialects = ["StandardOpsDialect"];
185200
}
186201

187202
//===----------------------------------------------------------------------===//
@@ -191,6 +206,7 @@ def SCFToStandard : Pass<"convert-scf-to-std"> {
191206
def ConvertAffineForToGPU : FunctionPass<"convert-affine-for-to-gpu"> {
192207
let summary = "Convert top-level AffineFor Ops to GPU kernels";
193208
let constructor = "mlir::createAffineForToGPUPass()";
209+
let dependentDialects = ["gpu::GPUDialect"];
194210
let options = [
195211
Option<"numBlockDims", "gpu-block-dims", "unsigned", /*default=*/"1u",
196212
"Number of GPU block dimensions for mapping">,
@@ -202,6 +218,7 @@ def ConvertAffineForToGPU : FunctionPass<"convert-affine-for-to-gpu"> {
202218
def ConvertParallelLoopToGpu : Pass<"convert-parallel-loops-to-gpu"> {
203219
let summary = "Convert mapped scf.parallel ops to gpu launch operations";
204220
let constructor = "mlir::createParallelLoopToGpuPass()";
221+
let dependentDialects = ["AffineDialect", "gpu::GPUDialect"];
205222
}
206223

207224
//===----------------------------------------------------------------------===//
@@ -212,6 +229,7 @@ def ConvertShapeToStandard : Pass<"convert-shape-to-std", "ModuleOp"> {
212229
let summary = "Convert operations from the shape dialect into the standard "
213230
"dialect";
214231
let constructor = "mlir::createConvertShapeToStandardPass()";
232+
let dependentDialects = ["StandardOpsDialect"];
215233
}
216234

217235
//===----------------------------------------------------------------------===//
@@ -221,6 +239,7 @@ def ConvertShapeToStandard : Pass<"convert-shape-to-std", "ModuleOp"> {
221239
def ConvertShapeToSCF : FunctionPass<"convert-shape-to-scf"> {
222240
let summary = "Convert operations from the shape dialect to the SCF dialect";
223241
let constructor = "mlir::createConvertShapeToSCFPass()";
242+
let dependentDialects = ["scf::SCFDialect"];
224243
}
225244

226245
//===----------------------------------------------------------------------===//
@@ -230,6 +249,7 @@ def ConvertShapeToSCF : FunctionPass<"convert-shape-to-scf"> {
230249
def ConvertSPIRVToLLVM : Pass<"convert-spirv-to-llvm", "ModuleOp"> {
231250
let summary = "Convert SPIR-V dialect to LLVM dialect";
232251
let constructor = "mlir::createConvertSPIRVToLLVMPass()";
252+
let dependentDialects = ["LLVM::LLVMDialect"];
233253
}
234254

235255
//===----------------------------------------------------------------------===//
@@ -264,6 +284,7 @@ def ConvertStandardToLLVM : Pass<"convert-std-to-llvm", "ModuleOp"> {
264284
LLVM IR types.
265285
}];
266286
let constructor = "mlir::createLowerToLLVMPass()";
287+
let dependentDialects = ["LLVM::LLVMDialect"];
267288
let options = [
268289
Option<"useAlignedAlloc", "use-aligned-alloc", "bool", /*default=*/"false",
269290
"Use aligned_alloc in place of malloc for heap allocations">,
@@ -287,11 +308,13 @@ def ConvertStandardToLLVM : Pass<"convert-std-to-llvm", "ModuleOp"> {
287308
def LegalizeStandardForSPIRV : Pass<"legalize-std-for-spirv"> {
288309
let summary = "Legalize standard ops for SPIR-V lowering";
289310
let constructor = "mlir::createLegalizeStdOpsForSPIRVLoweringPass()";
311+
let dependentDialects = ["spirv::SPIRVDialect"];
290312
}
291313

292314
def ConvertStandardToSPIRV : Pass<"convert-std-to-spirv", "ModuleOp"> {
293315
let summary = "Convert Standard Ops to SPIR-V dialect";
294316
let constructor = "mlir::createConvertStandardToSPIRVPass()";
317+
let dependentDialects = ["spirv::SPIRVDialect"];
295318
}
296319

297320
//===----------------------------------------------------------------------===//
@@ -302,6 +325,7 @@ def ConvertVectorToSCF : FunctionPass<"convert-vector-to-scf"> {
302325
let summary = "Lower the operations from the vector dialect into the SCF "
303326
"dialect";
304327
let constructor = "mlir::createConvertVectorToSCFPass()";
328+
let dependentDialects = ["AffineDialect", "scf::SCFDialect"];
305329
let options = [
306330
Option<"fullUnroll", "full-unroll", "bool", /*default=*/"false",
307331
"Perform full unrolling when converting vector transfers to SCF">,
@@ -316,6 +340,7 @@ def ConvertVectorToLLVM : Pass<"convert-vector-to-llvm", "ModuleOp"> {
316340
let summary = "Lower the operations from the vector dialect into the LLVM "
317341
"dialect";
318342
let constructor = "mlir::createConvertVectorToLLVMPass()";
343+
let dependentDialects = ["LLVM::LLVMDialect"];
319344
let options = [
320345
Option<"reassociateFPReductions", "reassociate-fp-reductions",
321346
"bool", /*default=*/"false",
@@ -331,6 +356,7 @@ def ConvertVectorToROCDL : Pass<"convert-vector-to-rocdl", "ModuleOp"> {
331356
let summary = "Lower the operations from the vector dialect into the ROCDL "
332357
"dialect";
333358
let constructor = "mlir::createConvertVectorToROCDLPass()";
359+
let dependentDialects = ["ROCDL::ROCDLDialect"];
334360
}
335361

336362
#endif // MLIR_CONVERSION_PASSES

mlir/include/mlir/Dialect/Affine/Passes.td

+1
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def AffineLoopUnrollAndJam : FunctionPass<"affine-loop-unroll-jam"> {
9494
def AffineVectorize : FunctionPass<"affine-super-vectorize"> {
9595
let summary = "Vectorize to a target independent n-D vector abstraction";
9696
let constructor = "mlir::createSuperVectorizePass()";
97+
let dependentDialects = ["vector::VectorDialect"];
9798
let options = [
9899
ListOption<"vectorSizes", "virtual-vector-size", "int64_t",
99100
"Specify an n-D virtual vector size for vectorization",

mlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#define MLIR_DIALECT_LLVMIR_LLVMDIALECT_H_
1616

1717
#include "mlir/Dialect/LLVMIR/LLVMTypes.h"
18+
#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
1819
#include "mlir/IR/Dialect.h"
1920
#include "mlir/IR/Function.h"
2021
#include "mlir/IR/OpDefinition.h"

mlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ include "mlir/IR/OpBase.td"
1919
def LLVM_Dialect : Dialect {
2020
let name = "llvm";
2121
let cppNamespace = "LLVM";
22+
23+
/// FIXME: at the moment this is a dependency of the translation to LLVM IR,
24+
/// not really one of this dialect per-se.
25+
let dependentDialects = ["omp::OpenMPDialect"];
26+
2227
let hasRegionArgAttrVerify = 1;
2328
let extraClassDeclaration = [{
2429
~LLVMDialect();

mlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#ifndef MLIR_DIALECT_LLVMIR_NVVMDIALECT_H_
1515
#define MLIR_DIALECT_LLVMIR_NVVMDIALECT_H_
1616

17+
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
1718
#include "mlir/IR/Dialect.h"
1819
#include "mlir/IR/OpDefinition.h"
1920
#include "mlir/Interfaces/SideEffectInterfaces.h"

mlir/include/mlir/Dialect/LLVMIR/NVVMOps.td

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ include "mlir/Interfaces/SideEffectInterfaces.td"
2323
def NVVM_Dialect : Dialect {
2424
let name = "nvvm";
2525
let cppNamespace = "NVVM";
26+
let dependentDialects = ["LLVM::LLVMDialect"];
2627
}
2728

2829
//===----------------------------------------------------------------------===//

mlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#ifndef MLIR_DIALECT_LLVMIR_ROCDLDIALECT_H_
2323
#define MLIR_DIALECT_LLVMIR_ROCDLDIALECT_H_
2424

25+
#include "mlir/Dialect/LLVMIR/LLVMDialect.h"
2526
#include "mlir/IR/Dialect.h"
2627
#include "mlir/IR/OpDefinition.h"
2728
#include "mlir/Interfaces/SideEffectInterfaces.h"

0 commit comments

Comments
 (0)