Skip to content

Commit 14c5101

Browse files
vogelsgesangtomtor
authored andcommitted
[coro][NFC] Move switch basic block to beginning of coroutine (llvm#143626)
This makes the code flow when reading the LLVM IR of a split coroutine a bit more natural. It does not change anything from an end-user perspective but makes debugging the CoroSplit pass slightly easier.
1 parent 97998b1 commit 14c5101

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Transforms/Coroutines/CoroSplit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -703,6 +703,7 @@ void coro::BaseCloner::replaceEntryBlock() {
703703
auto *SwitchBB =
704704
cast<BasicBlock>(VMap[Shape.SwitchLowering.ResumeEntryBlock]);
705705
Builder.CreateBr(SwitchBB);
706+
SwitchBB->moveAfter(Entry);
706707
break;
707708
}
708709
case coro::ABI::Async:

0 commit comments

Comments
 (0)