[Mlir-commits] [mlir] [mlir][Transforms] Make 1:N function conversion pattern interface-based (PR #92395)
    Ingo Müller 
    llvmlistbot at llvm.org
       
    Fri May 17 06:45:36 PDT 2024
    
    
  
================
@@ -412,4 +413,62 @@ applyPartialOneToNConversion(Operation *op, OneToNTypeConverter &typeConverter,
   return success();
 }
 
+namespace {
+class FunctionOpInterfaceSignatureConversion : public OneToNConversionPattern {
+public:
+  FunctionOpInterfaceSignatureConversion(StringRef functionLikeOpName,
+                                         MLIRContext *ctx,
+                                         TypeConverter &converter)
+      : OneToNConversionPattern(converter, functionLikeOpName, /*benefit=*/1,
+                                ctx) {}
+
+  LogicalResult matchAndRewrite(Operation *op, OneToNPatternRewriter &rewriter,
+                                const OneToNTypeMapping &operandMapping,
+                                const OneToNTypeMapping &resultMapping,
+                                ValueRange convertedOperands) const override {
+    auto funcOp = cast<FunctionOpInterface>(op);
----------------
ingomueller-net wrote:
You are right! Thanks for helping me see it!
https://github.com/llvm/llvm-project/pull/92395
    
    
More information about the Mlir-commits
mailing list