[Mlir-commits] [mlir] [mlir][gpu] GPUToROCDL/NVVM: use generic llvm conversion interface instead of hardcoded conversions. (PR #124439)
Jakub Kuderski
llvmlistbot at llvm.org
Sat Feb 8 09:43:41 PST 2025
================
@@ -376,17 +376,44 @@ struct LowerGpuOpsToNVVMOpsPass
LLVMTypeConverter converter(m.getContext(), options);
configureGpuToNVVMTypeConverter(converter);
RewritePatternSet llvmPatterns(m.getContext());
+ LLVMConversionTarget target(getContext());
+
+ if (!filterDialects.empty()) {
+ for (StringRef dialectName : filterDialects) {
+ Dialect *dialect = getContext().getLoadedDialect(dialectName);
+ // Dialect may not be loaded if it wasn't used in source module, ignore.
----------------
kuhar wrote:
What do you think about always querying `getContext().getLoadedDialects()` and filtering from there? I think this would help merge these two code paths a bit
https://github.com/llvm/llvm-project/pull/124439
More information about the Mlir-commits
mailing list