[Mlir-commits] [mlir] 47e3f94 - [mlir][SCF] Replace use of FuncOp with FunctionOpInterface

River Riddle llvmlistbot at llvm.org
Tue Mar 8 12:29:13 PST 2022


Author: River Riddle
Date: 2022-03-08T12:25:32-08:00
New Revision: 47e3f946367381c57c5219456a0de8a70f8073bb

URL: https://github.com/llvm/llvm-project/commit/47e3f946367381c57c5219456a0de8a70f8073bb
DIFF: https://github.com/llvm/llvm-project/commit/47e3f946367381c57c5219456a0de8a70f8073bb.diff

LOG: [mlir][SCF] Replace use of FuncOp with FunctionOpInterface

There is nothing specific to FuncOp about the check, it can be changed
to be interface based.

Differential Revision: https://reviews.llvm.org/D121194

Added: 
    

Modified: 
    mlir/lib/Dialect/SCF/SCF.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SCF/SCF.cpp b/mlir/lib/Dialect/SCF/SCF.cpp
index 588c675f50423..aced058682f61 100644
--- a/mlir/lib/Dialect/SCF/SCF.cpp
+++ b/mlir/lib/Dialect/SCF/SCF.cpp
@@ -11,6 +11,7 @@
 #include "mlir/Dialect/Bufferization/IR/Bufferization.h"
 #include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"
 #include "mlir/IR/BlockAndValueMapping.h"
+#include "mlir/IR/FunctionInterfaces.h"
 #include "mlir/IR/Matchers.h"
 #include "mlir/IR/PatternMatch.h"
 #include "mlir/Support/MathExtras.h"
@@ -201,7 +202,7 @@ struct MultiBlockExecuteInliner : public OpRewritePattern<ExecuteRegionOp> {
 
   LogicalResult matchAndRewrite(ExecuteRegionOp op,
                                 PatternRewriter &rewriter) const override {
-    if (!isa<FuncOp, ExecuteRegionOp>(op->getParentOp()))
+    if (!isa<FunctionOpInterface, ExecuteRegionOp>(op->getParentOp()))
       return failure();
 
     Block *prevBlock = op->getBlock();


        


More information about the Mlir-commits mailing list