File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -236,6 +236,8 @@ struct MultiBlockExecuteInliner : public OpRewritePattern<ExecuteRegionOp> {
236236
237237 LogicalResult matchAndRewrite (ExecuteRegionOp op,
238238 PatternRewriter &rewriter) const override {
239+ if (op.getNoInline ())
240+ return failure ();
239241 if (!isa<FunctionOpInterface, ExecuteRegionOp>(op->getParentOp ()))
240242 return failure ();
241243
Original file line number Diff line number Diff line change @@ -1483,6 +1483,24 @@ func.func @execute_region_no_inline() {
14831483
14841484// -----
14851485
1486+ // CHECK-LABEL: func @execute_region_under_func_no_inline
1487+ func.func @execute_region_under_func_no_inline () {
1488+ " test.foo" () : () -> ()
1489+ %v = scf.execute_region -> i64 no_inline {
1490+ %x = " test.val" () : () -> i64
1491+ scf.yield %x : i64
1492+ }
1493+ " test.bar" (%v ) : (i64 ) -> ()
1494+ return
1495+ }
1496+
1497+ // CHECK-NEXT: "test.foo"() : () -> ()
1498+ // CHECK-NEXT: scf.execute_region
1499+ // CHECK-NEXT: %[[VAL:.*]] = "test.val"() : () -> i64
1500+ // CHECK-NEXT: scf.yield %[[VAL]] : i64
1501+
1502+ // -----
1503+
14861504// CHECK-LABEL: func @func_execute_region_inline
14871505func.func @func_execute_region_inline () {
14881506 " test.foo" () : () -> ()
You can’t perform that action at this time.
0 commit comments