[Mlir-commits] [mlir] [mlir][LLVM] Add the `ConvertToLLVMAttrInterface` and `ConvertToLLVMOpInterface` interfaces (PR #99566)

Mehdi Amini llvmlistbot at llvm.org
Tue Nov 19 07:56:28 PST 2024


================
@@ -61,6 +61,8 @@ class LoadDependentDialectExtension : public DialectExtensionBase {
 /// the injection of conversion patterns.
 class ConvertToLLVMPass
     : public impl::ConvertToLLVMPassBase<ConvertToLLVMPass> {
+  std::shared_ptr<const SmallVector<ConvertToLLVMPatternInterface *>>
+      interfaces;
   std::shared_ptr<const FrozenRewritePatternSet> patterns;
   std::shared_ptr<const ConversionTarget> target;
   std::shared_ptr<const LLVMTypeConverter> typeConverter;
----------------
joker-eph wrote:

There should be much more documentation around this, because you're introducing subtle invariants where fields are only used in one of two modes, and uninitialized in the other. This kind of modal behavior isn't great in general.


Can we actually refactor this by encapsulating this into another abstract class, with two implementations and then unifying all the downstream code from there?

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


More information about the Mlir-commits mailing list