[Mlir-commits] [mlir] [MLIR][LLVMIR] Import: add flag to prefer using unregistered intrinsics (PR #130685)
Tobias Gysi
llvmlistbot at llvm.org
Tue Mar 11 00:40:08 PDT 2025
================
@@ -41,11 +41,13 @@ class ModuleOp;
/// adversarial inputs.
/// The `loadAllDialects` flag (default on) will load all dialects in the
/// context.
-OwningOpRef<ModuleOp>
-translateLLVMIRToModule(std::unique_ptr<llvm::Module> llvmModule,
- MLIRContext *context, bool emitExpensiveWarnings = true,
- bool dropDICompositeTypeElements = false,
- bool loadAllDialects = true);
+/// The `preferUnregisteredIntrinsics` flag (default off) controls whether to
+/// prefer generic version of imported intrinsics with `llvm.intrinsic_call`
+/// than using versions supported by a dialects.
----------------
gysit wrote:
```suggestion
/// import all intrinsics using `llvm.intrinsic_call` even if a dialect registered an explicit intrinsic operation.
/// Warning: passes that rely on matching explicit intrinsic operations may not work properly if this flag is enabled.
```
I think we should add a warning here that this may not work with passes that rely on matching explicit intrinsics. Upstream there is probably no problem, but downstream we have passes that need to match specific intrinsic.
https://github.com/llvm/llvm-project/pull/130685
More information about the Mlir-commits
mailing list