[Mlir-commits] [mlir] [mlir][LLVM] Add the `ConvertToLLVMAttrInterface` and `ConvertToLLVMOpInterface` interfaces (PR #99566)
Mehdi Amini
llvmlistbot at llvm.org
Sat Jul 27 05:09:14 PDT 2024
================
@@ -30,3 +30,20 @@ void mlir::populateConversionTargetFromOperation(
patterns);
});
}
+
+void mlir::populateOpConvertToLLVMConversionPatterns(
+ Operation *op, ConversionTarget &target, LLVMTypeConverter &typeConverter,
+ RewritePatternSet &patterns) {
+ auto iface = dyn_cast<ConvertToLLVMOpInterface>(op);
+ if (!iface)
+ return;
+ SmallVector<ConvertToLLVMAttrInterface, 12> attrs;
+ iface.getConvertToLLVMConversionAttrs(attrs);
+ for (ConvertToLLVMAttrInterface attr : attrs)
+ attr.populateConvertToLLVMConversionPatterns(target, typeConverter,
+ patterns);
+}
----------------
joker-eph wrote:
> However, I also think it is reasonable for users to expect that a pass might perform different actions depending on the op context.
Yes but here it's not the "op context": what I'm describing is the exact same input IR, but the pass pipeline configured differently
https://github.com/llvm/llvm-project/pull/99566
More information about the Mlir-commits
mailing list