[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:07 PDT 2025


================
@@ -277,6 +278,12 @@ class ModuleImport {
   void convertParameterAttributes(llvm::CallBase *call, ArrayAttr &argsAttr,
                                   ArrayAttr &resAttr, OpBuilder &builder);
 
+  /// Whether the importer should try to convert all intrinsics to
+  /// llvm.call_intrinsic instead of dialect supported operations.
+  bool useUnregisteredIntrinsicsOnly() const {
----------------
gysit wrote:

I wonder if we should start moving the entire unregistered intrinsic handling back into module import:

https://github.com/llvm/llvm-project/blob/f120b0d6d2629e226e6fa75974fbd17f46206bca/mlir/lib/Target/LLVMIR/ModuleImport.cpp#L1651C1-L1652C1

I this function we could try to convert with a dialect interface if preferUnregisteredIntrinsics is not set and then fallback to the translation with call_intrinsic? That way we can make a couple of functions internal to the import and the interface does not need to deal with the unregistered intrinsics?

https://github.com/llvm/llvm-project/pull/130685


More information about the Mlir-commits mailing list