Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[handshake] StandardToHandshake conversion now removes blocks. #45

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 37 additions & 19 deletions lib/Conversion/StandardToHandshake/StandardToHandshake.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,39 @@ using namespace std;
typedef DenseMap<Block *, vector<Value>> BlockValues;
typedef DenseMap<Block *, vector<Operation *>> BlockOps;

template <typename FuncOp>

/// Remove basic blocks inside the given FuncOp. This allows the result to be
/// a valid graph region, since multi-basic block regions are not allowed to
/// be graph regions currently.
void removeBasicBlocks(handshake::FuncOp funcOp) {
auto &entryBlock = funcOp.getBody().front().getOperations();

// Erase all TerminatorOp, and move ReturnOp to the end of entry block.
for (auto &block : funcOp) {
Operation &termOp = block.back();
if (isa<handshake::TerminatorOp>(termOp))
termOp.erase();
else if (isa<handshake::ReturnOp>(termOp))
entryBlock.splice(entryBlock.end(), block.getOperations(), termOp);
}

// Move all operations to entry block and erase other blocks.
for (auto &block :
llvm::make_early_inc_range(llvm::drop_begin(funcOp, 1))) {
entryBlock.splice(--entryBlock.end(), block.getOperations());
}
for (auto &block :
llvm::make_early_inc_range(llvm::drop_begin(funcOp, 1))) {
block.clear();
block.dropAllDefinedValueUses();
for (int i = 0; i < block.getNumArguments(); i++) {
block.eraseArgument(i);
}
block.erase();
}
}

template <typename FuncOp>
void dotPrint(FuncOp f, string name) {
// Prints DOT representation of the dataflow graph, used for debugging
DenseMap<Block *, unsigned> blockIDs;
Expand Down Expand Up @@ -1391,24 +1422,7 @@ struct HandshakeRemoveBlockPass
: public PassWrapper<HandshakeRemoveBlockPass,
OperationPass<handshake::FuncOp>> {
void runOnOperation() override {
auto funcOp = getOperation();
auto &entryBlock = funcOp.getBody().front().getOperations();

// Erase all TerminatorOp, and move ReturnOp to the end of entry block.
for (auto &block : funcOp) {
Operation &termOp = block.back();
if (isa<handshake::TerminatorOp>(termOp))
termOp.erase();
else if (isa<handshake::ReturnOp>(termOp))
entryBlock.splice(entryBlock.end(), block.getOperations(), termOp);
}

// Move all operations to entry block and erase other blocks.
for (auto &block :
llvm::make_early_inc_range(llvm::drop_begin(funcOp, 1))) {
entryBlock.splice(--entryBlock.end(), block.getOperations());
block.erase();
}
removeBasicBlocks(getOperation());
}
};
Comment on lines 1422 to 1427
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's reasonable to delete the -remove-block-structure pass now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe. I think we should keep it for the moment. I'd like to think that we get multi-block graph regions supported before too long.


Expand All @@ -1425,6 +1439,10 @@ struct HandshakePass

if (failed(applyPartialConversion(m, target, patterns)))
signalPassFailure();

// Legalize the resulting regions, which can have no basic blocks.
for (auto func : m.getOps<handshake::FuncOp>())
removeBasicBlocks(func);
}
};

Expand Down
9 changes: 1 addition & 8 deletions test/Conversion/StandardToHandshake/test1.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ func @simple_loop() {
// CHECK-LABEL: handshake.func @simple_loop(
// CHECK-SAME: %[[VAL_0:.*]]: none, ...) -> none {
// CHECK: %[[VAL_1:.*]] = "handshake.branch"(%[[VAL_0]]) {control = true} : (none) -> none
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb1:
// CHECK: %[[VAL_2:.*]]:2 = "handshake.control_merge"(%[[VAL_1]]) {control = true} : (none) -> (none, index)
// CHECK: %[[VAL_3:.*]]:3 = "handshake.fork"(%[[VAL_2]]#0) {control = true} : (none) -> (none, none, none)
// CHECK: "handshake.sink"(%[[VAL_2]]#1) : (index) -> ()
Expand All @@ -16,8 +14,6 @@ func @simple_loop() {
// CHECK: %[[VAL_6:.*]] = "handshake.branch"(%[[VAL_3]]#2) {control = true} : (none) -> none
// CHECK: %[[VAL_7:.*]] = "handshake.branch"(%[[VAL_4]]) {control = false} : (index) -> index
// CHECK: %[[VAL_8:.*]] = "handshake.branch"(%[[VAL_5]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb2] : () -> ()
// CHECK: ^bb2:
// CHECK: %[[VAL_9:.*]] = "handshake.mux"(%[[VAL_10:.*]]#1, %[[VAL_11:.*]], %[[VAL_8]]) : (index, index, index) -> index
// CHECK: %[[VAL_12:.*]]:2 = "handshake.fork"(%[[VAL_9]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_13:.*]]:2 = "handshake.control_merge"(%[[VAL_14:.*]], %[[VAL_6]]) {control = true} : (none, none) -> (none, index)
Expand All @@ -31,8 +27,6 @@ func @simple_loop() {
// CHECK: %[[VAL_22:.*]], %[[VAL_23:.*]] = "handshake.conditional_branch"(%[[VAL_19]]#1, %[[VAL_13]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_24:.*]], %[[VAL_25:.*]] = "handshake.conditional_branch"(%[[VAL_19]]#0, %[[VAL_17]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_25]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb3, ^bb4] : () -> ()
// CHECK: ^bb3:
// CHECK: %[[VAL_26:.*]] = "handshake.merge"(%[[VAL_24]]) : (index) -> index
// CHECK: %[[VAL_27:.*]] = "handshake.merge"(%[[VAL_20]]) : (index) -> index
// CHECK: %[[VAL_28:.*]]:2 = "handshake.control_merge"(%[[VAL_22]]) {control = true} : (none) -> (none, index)
Expand All @@ -43,13 +37,12 @@ func @simple_loop() {
// CHECK: %[[VAL_11]] = "handshake.branch"(%[[VAL_27]]) {control = false} : (index) -> index
// CHECK: %[[VAL_14]] = "handshake.branch"(%[[VAL_29]]#1) {control = true} : (none) -> none
// CHECK: %[[VAL_16]] = "handshake.branch"(%[[VAL_31]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb2] : () -> ()
// CHECK: ^bb4:
// CHECK: %[[VAL_32:.*]]:2 = "handshake.control_merge"(%[[VAL_23]]) {control = true} : (none) -> (none, index)
// CHECK: "handshake.sink"(%[[VAL_32]]#1) : (index) -> ()
// CHECK: handshake.return %[[VAL_32]]#0 : none
// CHECK: }
// CHECK: }

^bb0:
br ^bb1
^bb1: // pred: ^bb0
Expand Down
7 changes: 1 addition & 6 deletions test/Conversion/StandardToHandshake/test10.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
// CHECK: %[[VAL_19:.*]] = "handshake.branch"(%[[VAL_9]]) {control = false} : (index) -> index
// CHECK: %[[VAL_20:.*]] = "handshake.branch"(%[[VAL_10]]) {control = false} : (index) -> index
// CHECK: %[[VAL_21:.*]] = "handshake.branch"(%[[VAL_11]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb1:
// CHECK: %[[VAL_22:.*]] = "handshake.mux"(%[[VAL_23:.*]]#8, %[[VAL_24:.*]], %[[VAL_20]]) : (index, index, index) -> index
// CHECK: %[[VAL_25:.*]]:2 = "handshake.fork"(%[[VAL_22]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_26:.*]] = "handshake.mux"(%[[VAL_23]]#7, %[[VAL_27:.*]], %[[VAL_12]]) : (index, index, index) -> index
Expand Down Expand Up @@ -61,8 +59,6 @@
// CHECK: %[[VAL_63:.*]], %[[VAL_64:.*]] = "handshake.conditional_branch"(%[[VAL_46]]#1, %[[VAL_40]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_65:.*]], %[[VAL_66:.*]] = "handshake.conditional_branch"(%[[VAL_46]]#0, %[[VAL_44]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_66]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb2, ^bb3] : () -> ()
// CHECK: ^bb2:
// CHECK: %[[VAL_67:.*]] = "handshake.merge"(%[[VAL_65]]) : (index) -> index
// CHECK: %[[VAL_68:.*]]:2 = "handshake.fork"(%[[VAL_67]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_69:.*]] = "handshake.merge"(%[[VAL_49]]) : (index) -> index
Expand Down Expand Up @@ -99,13 +95,12 @@
// CHECK: %[[VAL_24]] = "handshake.branch"(%[[VAL_83]]) {control = false} : (index) -> index
// CHECK: %[[VAL_41]] = "handshake.branch"(%[[VAL_85]]#2) {control = true} : (none) -> none
// CHECK: %[[VAL_43]] = "handshake.branch"(%[[VAL_90]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb3:
// CHECK: %[[VAL_91:.*]]:2 = "handshake.control_merge"(%[[VAL_64]]) {control = true} : (none) -> (none, index)
// CHECK: "handshake.sink"(%[[VAL_91]]#1) : (index) -> ()
// CHECK: handshake.return %[[VAL_91]]#0 : none
// CHECK: }
// CHECK: }

%0 = alloc() : memref<100xf32>
%1 = alloc() : memref<100xf32, 2>
%2 = alloc() : memref<1xi32>
Expand Down
13 changes: 1 addition & 12 deletions test/Conversion/StandardToHandshake/test11.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// CHECK: %[[VAL_6:.*]] = "handshake.branch"(%[[VAL_2]]) {control = false} : (index) -> index
// CHECK: %[[VAL_7:.*]] = "handshake.branch"(%[[VAL_3]]) {control = false} : (index) -> index
// CHECK: %[[VAL_8:.*]] = "handshake.branch"(%[[VAL_4]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb1:
// CHECK: %[[VAL_9:.*]] = "handshake.mux"(%[[VAL_10:.*]]#2, %[[VAL_11:.*]], %[[VAL_7]]) : (index, index, index) -> index
// CHECK: %[[VAL_12:.*]]:2 = "handshake.fork"(%[[VAL_9]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_13:.*]] = "handshake.mux"(%[[VAL_10]]#1, %[[VAL_14:.*]], %[[VAL_8]]) : (index, index, index) -> index
Expand All @@ -31,8 +29,6 @@
// CHECK: %[[VAL_26:.*]], %[[VAL_27:.*]] = "handshake.conditional_branch"(%[[VAL_21]]#1, %[[VAL_15]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_28:.*]], %[[VAL_29:.*]] = "handshake.conditional_branch"(%[[VAL_21]]#0, %[[VAL_19]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_29]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb2, ^bb6] : () -> ()
// CHECK: ^bb2:
// CHECK: %[[VAL_30:.*]] = "handshake.merge"(%[[VAL_28]]) : (index) -> index
// CHECK: %[[VAL_31:.*]] = "handshake.merge"(%[[VAL_24]]) : (index) -> index
// CHECK: %[[VAL_32:.*]] = "handshake.merge"(%[[VAL_22]]) : (index) -> index
Expand All @@ -49,8 +45,6 @@
// CHECK: %[[VAL_42:.*]] = "handshake.branch"(%[[VAL_35]]) {control = false} : (index) -> index
// CHECK: %[[VAL_43:.*]] = "handshake.branch"(%[[VAL_36]]) {control = false} : (index) -> index
// CHECK: %[[VAL_44:.*]] = "handshake.branch"(%[[VAL_37]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb3] : () -> ()
// CHECK: ^bb3:
// CHECK: %[[VAL_45:.*]] = "handshake.mux"(%[[VAL_46:.*]]#5, %[[VAL_47:.*]], %[[VAL_43]]) : (index, index, index) -> index
// CHECK: %[[VAL_48:.*]]:2 = "handshake.fork"(%[[VAL_45]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_49:.*]] = "handshake.mux"(%[[VAL_46]]#4, %[[VAL_50:.*]], %[[VAL_44]]) : (index, index, index) -> index
Expand All @@ -73,8 +67,6 @@
// CHECK: %[[VAL_74:.*]], %[[VAL_75:.*]] = "handshake.conditional_branch"(%[[VAL_63]]#1, %[[VAL_57]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_76:.*]], %[[VAL_77:.*]] = "handshake.conditional_branch"(%[[VAL_63]]#0, %[[VAL_61]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_77]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb4, ^bb5] : () -> ()
// CHECK: ^bb4:
// CHECK: %[[VAL_78:.*]] = "handshake.merge"(%[[VAL_76]]) : (index) -> index
// CHECK: %[[VAL_79:.*]] = "handshake.merge"(%[[VAL_66]]) : (index) -> index
// CHECK: %[[VAL_80:.*]]:2 = "handshake.fork"(%[[VAL_79]]) {control = false} : (index) -> (index, index)
Expand All @@ -92,8 +84,6 @@
// CHECK: %[[VAL_56]] = "handshake.branch"(%[[VAL_84]]) {control = false} : (index) -> index
// CHECK: %[[VAL_58]] = "handshake.branch"(%[[VAL_85]]#0) {control = true} : (none) -> none
// CHECK: %[[VAL_60]] = "handshake.branch"(%[[VAL_86]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb3] : () -> ()
// CHECK: ^bb5:
// CHECK: %[[VAL_87:.*]] = "handshake.merge"(%[[VAL_69]]) : (index) -> index
// CHECK: %[[VAL_88:.*]] = "handshake.merge"(%[[VAL_71]]) : (index) -> index
// CHECK: %[[VAL_89:.*]]:2 = "handshake.fork"(%[[VAL_88]]) {control = false} : (index) -> (index, index)
Expand All @@ -105,13 +95,12 @@
// CHECK: %[[VAL_11]] = "handshake.branch"(%[[VAL_90]]) {control = false} : (index) -> index
// CHECK: %[[VAL_16]] = "handshake.branch"(%[[VAL_91]]#0) {control = true} : (none) -> none
// CHECK: %[[VAL_18]] = "handshake.branch"(%[[VAL_92]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb6:
// CHECK: %[[VAL_93:.*]]:2 = "handshake.control_merge"(%[[VAL_27]]) {control = true} : (none) -> (none, index)
// CHECK: "handshake.sink"(%[[VAL_93]]#1) : (index) -> ()
// CHECK: handshake.return %[[VAL_93]]#0 : none
// CHECK: }
// CHECK: }

%c0 = constant 0 : index
%c42 = constant 42 : index
%c1 = constant 1 : index
Expand Down
19 changes: 1 addition & 18 deletions test/Conversion/StandardToHandshake/test12.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
// CHECK: %[[VAL_6:.*]] = "handshake.branch"(%[[VAL_2]]) {control = false} : (index) -> index
// CHECK: %[[VAL_7:.*]] = "handshake.branch"(%[[VAL_3]]) {control = false} : (index) -> index
// CHECK: %[[VAL_8:.*]] = "handshake.branch"(%[[VAL_4]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb1:
// CHECK: %[[VAL_9:.*]] = "handshake.mux"(%[[VAL_10:.*]]#2, %[[VAL_11:.*]], %[[VAL_7]]) : (index, index, index) -> index
// CHECK: %[[VAL_12:.*]]:2 = "handshake.fork"(%[[VAL_9]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_13:.*]] = "handshake.mux"(%[[VAL_10]]#1, %[[VAL_14:.*]], %[[VAL_8]]) : (index, index, index) -> index
Expand All @@ -31,8 +29,6 @@
// CHECK: %[[VAL_26:.*]], %[[VAL_27:.*]] = "handshake.conditional_branch"(%[[VAL_21]]#1, %[[VAL_15]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_28:.*]], %[[VAL_29:.*]] = "handshake.conditional_branch"(%[[VAL_21]]#0, %[[VAL_19]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_29]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb2, ^bb9] : () -> ()
// CHECK: ^bb2:
// CHECK: %[[VAL_30:.*]] = "handshake.merge"(%[[VAL_28]]) : (index) -> index
// CHECK: %[[VAL_31:.*]] = "handshake.merge"(%[[VAL_24]]) : (index) -> index
// CHECK: %[[VAL_32:.*]] = "handshake.merge"(%[[VAL_22]]) : (index) -> index
Expand All @@ -49,8 +45,6 @@
// CHECK: %[[VAL_42:.*]] = "handshake.branch"(%[[VAL_35]]) {control = false} : (index) -> index
// CHECK: %[[VAL_43:.*]] = "handshake.branch"(%[[VAL_36]]) {control = false} : (index) -> index
// CHECK: %[[VAL_44:.*]] = "handshake.branch"(%[[VAL_37]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb3] : () -> ()
// CHECK: ^bb3:
// CHECK: %[[VAL_45:.*]] = "handshake.mux"(%[[VAL_46:.*]]#5, %[[VAL_47:.*]], %[[VAL_43]]) : (index, index, index) -> index
// CHECK: %[[VAL_48:.*]]:2 = "handshake.fork"(%[[VAL_45]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_49:.*]] = "handshake.mux"(%[[VAL_46]]#4, %[[VAL_50:.*]], %[[VAL_44]]) : (index, index, index) -> index
Expand All @@ -73,8 +67,6 @@
// CHECK: %[[VAL_74:.*]], %[[VAL_75:.*]] = "handshake.conditional_branch"(%[[VAL_63]]#1, %[[VAL_57]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_76:.*]], %[[VAL_77:.*]] = "handshake.conditional_branch"(%[[VAL_63]]#0, %[[VAL_61]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_77]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb4, ^bb5] : () -> ()
// CHECK: ^bb4:
// CHECK: %[[VAL_78:.*]] = "handshake.merge"(%[[VAL_76]]) : (index) -> index
// CHECK: %[[VAL_79:.*]] = "handshake.merge"(%[[VAL_66]]) : (index) -> index
// CHECK: %[[VAL_80:.*]]:2 = "handshake.fork"(%[[VAL_79]]) {control = false} : (index) -> (index, index)
Expand All @@ -92,8 +84,6 @@
// CHECK: %[[VAL_56]] = "handshake.branch"(%[[VAL_84]]) {control = false} : (index) -> index
// CHECK: %[[VAL_58]] = "handshake.branch"(%[[VAL_85]]#0) {control = true} : (none) -> none
// CHECK: %[[VAL_60]] = "handshake.branch"(%[[VAL_86]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb3] : () -> ()
// CHECK: ^bb5:
// CHECK: %[[VAL_87:.*]] = "handshake.merge"(%[[VAL_69]]) : (index) -> index
// CHECK: %[[VAL_88:.*]] = "handshake.merge"(%[[VAL_71]]) : (index) -> index
// CHECK: %[[VAL_89:.*]] = "handshake.merge"(%[[VAL_73]]) : (index) -> index
Expand All @@ -110,8 +100,6 @@
// CHECK: %[[VAL_99:.*]] = "handshake.branch"(%[[VAL_92]]) {control = false} : (index) -> index
// CHECK: %[[VAL_100:.*]] = "handshake.branch"(%[[VAL_93]]) {control = false} : (index) -> index
// CHECK: %[[VAL_101:.*]] = "handshake.branch"(%[[VAL_94]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb6] : () -> ()
// CHECK: ^bb6:
// CHECK: %[[VAL_102:.*]] = "handshake.mux"(%[[VAL_103:.*]]#5, %[[VAL_104:.*]], %[[VAL_100]]) : (index, index, index) -> index
// CHECK: %[[VAL_105:.*]]:2 = "handshake.fork"(%[[VAL_102]]) {control = false} : (index) -> (index, index)
// CHECK: %[[VAL_106:.*]] = "handshake.mux"(%[[VAL_103]]#4, %[[VAL_107:.*]], %[[VAL_101]]) : (index, index, index) -> index
Expand All @@ -134,8 +122,6 @@
// CHECK: %[[VAL_131:.*]], %[[VAL_132:.*]] = "handshake.conditional_branch"(%[[VAL_120]]#1, %[[VAL_114]]#0) {control = true} : (i1, none) -> (none, none)
// CHECK: %[[VAL_133:.*]], %[[VAL_134:.*]] = "handshake.conditional_branch"(%[[VAL_120]]#0, %[[VAL_118]]#0) {control = false} : (i1, index) -> (index, index)
// CHECK: "handshake.sink"(%[[VAL_134]]) : (index) -> ()
// CHECK: "handshake.terminator"()[^bb7, ^bb8] : () -> ()
// CHECK: ^bb7:
// CHECK: %[[VAL_135:.*]] = "handshake.merge"(%[[VAL_133]]) : (index) -> index
// CHECK: %[[VAL_136:.*]] = "handshake.merge"(%[[VAL_123]]) : (index) -> index
// CHECK: %[[VAL_137:.*]]:2 = "handshake.fork"(%[[VAL_136]]) {control = false} : (index) -> (index, index)
Expand All @@ -153,8 +139,6 @@
// CHECK: %[[VAL_113]] = "handshake.branch"(%[[VAL_141]]) {control = false} : (index) -> index
// CHECK: %[[VAL_115]] = "handshake.branch"(%[[VAL_142]]#0) {control = true} : (none) -> none
// CHECK: %[[VAL_117]] = "handshake.branch"(%[[VAL_143]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb6] : () -> ()
// CHECK: ^bb8:
// CHECK: %[[VAL_144:.*]] = "handshake.merge"(%[[VAL_126]]) : (index) -> index
// CHECK: %[[VAL_145:.*]] = "handshake.merge"(%[[VAL_128]]) : (index) -> index
// CHECK: %[[VAL_146:.*]]:2 = "handshake.fork"(%[[VAL_145]]) {control = false} : (index) -> (index, index)
Expand All @@ -166,13 +150,12 @@
// CHECK: %[[VAL_11]] = "handshake.branch"(%[[VAL_147]]) {control = false} : (index) -> index
// CHECK: %[[VAL_16]] = "handshake.branch"(%[[VAL_148]]#0) {control = true} : (none) -> none
// CHECK: %[[VAL_18]] = "handshake.branch"(%[[VAL_149]]) {control = false} : (index) -> index
// CHECK: "handshake.terminator"()[^bb1] : () -> ()
// CHECK: ^bb9:
// CHECK: %[[VAL_150:.*]]:2 = "handshake.control_merge"(%[[VAL_27]]) {control = true} : (none) -> (none, index)
// CHECK: "handshake.sink"(%[[VAL_150]]#1) : (index) -> ()
// CHECK: handshake.return %[[VAL_150]]#0 : none
// CHECK: }
// CHECK: }

%c0 = constant 0 : index
%c42 = constant 42 : index
%c1 = constant 1 : index
Expand Down
Loading