Skip to content

Commit

Permalink
[DemoteRegToStack] Use correct variable for branch instructions in De…
Browse files Browse the repository at this point in the history
…moteRegToStack (#113798)

I happened to see this code, and it seems "obviously" wrong to me. So
here's what I think this code is supposed to look like.
  • Loading branch information
eirikba authored Oct 27, 2024
1 parent 60d2fed commit d2e9532
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Utils/DemoteRegToStack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ AllocaInst *llvm::DemoteRegToStack(Instruction &I, bool VolatileLoads,
for (unsigned i = 0; i < CBI->getNumSuccessors(); i++) {
auto *Succ = CBI->getSuccessor(i);
if (!Succ->getSinglePredecessor()) {
assert(isCriticalEdge(II, i) && "Expected a critical edge!");
[[maybe_unused]] BasicBlock *BB = SplitCriticalEdge(II, i);
assert(isCriticalEdge(CBI, i) && "Expected a critical edge!");
[[maybe_unused]] BasicBlock *BB = SplitCriticalEdge(CBI, i);
assert(BB && "Unable to split critical edge.");
}
}
Expand Down

0 comments on commit d2e9532

Please sign in to comment.