[Mlir-commits] [mlir] Reapply [MLIR][LLVMIR] Import unregistered intrinsics via llvm.intrin… (PR #129174)

Bruno Cardoso Lopes llvmlistbot at llvm.org
Fri Feb 28 18:22:11 PST 2025


================
@@ -1642,6 +1642,46 @@ FlatSymbolRefAttr ModuleImport::convertCalleeName(llvm::CallBase *callInst) {
   return {};
 }
 
+LogicalResult mlir::LLVMImportInterface::convertUnregisteredIntrinsic(
----------------
bcardosolopes wrote:

> Having it in the interface seems more consistent but there was a linking issue?

Oh, I meant something else: add a new interface method so it could be called via `iface->`.

> Alternative could also be to go back to the implementation method which is just a static function as it was in your original PR. That is also ok!

In the original one we had the DenseMap in `convertIntrinsic` to pick a dialect, and the original `convertUnregisteredIntrinsic` was then done in `LLVMIRToLLVMTranslation.cpp` and was called from `convertIntrinsicImpl`. We cannot do that right now because we don't have the dense map and code will never reach this path again unless it's a supported intrinsic.

I went for another solution instead: created a new implementation file to cover the header. The other approach I can think about is to introduce the new interface method mentioned above (but seems unnecessary boilerplate given other dialects won't implement it?).

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


More information about the Mlir-commits mailing list