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 @@ -237,6 +237,8 @@ struct MultiBlockExecuteInliner : public OpRewritePattern<ExecuteRegionOp> {
237
237
238
238
LogicalResult matchAndRewrite (ExecuteRegionOp op,
239
239
PatternRewriter &rewriter) const override {
240
+ if (op.getNoInline ())
241
+ return failure ();
240
242
if (!isa<FunctionOpInterface, ExecuteRegionOp>(op->getParentOp ()))
241
243
return failure ();
242
244
Original file line number Diff line number Diff line change @@ -1483,6 +1483,24 @@ func.func @execute_region_no_inline() {
1483
1483
1484
1484
// -----
1485
1485
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
+
1486
1504
// CHECK-LABEL: func @func_execute_region_inline
1487
1505
func.func @func_execute_region_inline () {
1488
1506
" test.foo" () : () -> ()
You can’t perform that action at this time.
0 commit comments