[PATCH] D103593: [Coroutine] Sink lifetime markers after switch of suspend blocks to avoid disturbing must tail calls
John McCall via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 3 18:44:33 PDT 2021
rjmccall added inline comments.
================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2343
"should have split coro.suspend into its own block");
- DomSet.insert(SuspendBlock->getSingleSuccessor());
+ BasicBlock *SwitchBlock = SuspendBlock->getSingleSuccessor();
+ for (auto *BB : llvm::successors(SwitchBlock))
----------------
Can we assert that this is a switch block somehow? This is very dangerous if the code pattern isn't what we expect.
================
Comment at: llvm/lib/Transforms/Coroutines/CoroFrame.cpp:2404
+ NewLifetime->replaceUsesOfWith(NewLifetime->getOperand(1),
+ NewBitCast);
+ NewLifetime->insertAfter(NewBitCast);
----------------
Is this not just `NewLifetime->setOperand(1, NewBitCast)`?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103593/new/
https://reviews.llvm.org/D103593
More information about the llvm-commits
mailing list