================
@@ -52,16 +48,10 @@ void CIRGenerator::Initialize(ASTContext &astContext) {
this->astContext = &astContext;
mlirContext = std::make_unique<mlir::MLIRContext>();
- mlirContext->loadDialect<mlir::DLTIDialect>();
- mlirContext->loadDialect<cir::CIRDialect>();
- mlirContext->getOrLoadDialect<mlir::acc::OpenACCDialect>();
- mlirContext->getOrLoadDialect<mlir::omp::OpenMPDialect>();
-
- // Register extensions to integrate CIR types with OpenACC and OpenMP.
mlir::DialectRegistry registry;
- cir::acc::registerOpenACCExtensions(registry);
- cir::omp::registerOpenMPExtensions(registry);
+ cir::registerCIRDialects(registry);
mlirContext->appendDialectRegistry(registry);
+ mlirContext->loadAllAvailableDialects();
----------------
xlauko wrote:
```suggestion
```
`appendDialectRegistry` registers dialects for lazy loading. They're loaded on
first use. Calling `loadAllAvailableDialects()` immediately negates that,
eagerly loading all 5 dialects at context creation.
https://github.com/llvm/llvm-project/pull/200266
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits