[SimplifyCFG] Common code sinking: fixup variable name

As noticed in post-commit review.

I've gone through several iterations of that name,
and somehow managed to end up with an incorrect one.
This commit is contained in:
Roman Lebedev 2021-04-29 01:23:44 +03:00
parent e20b32ff3b
commit 707ad01399
No known key found for this signature in database
GPG Key ID: 083C3EBB4A1689E0
1 changed files with 3 additions and 3 deletions

View File

@ -1988,13 +1988,13 @@ static bool SinkCommonCodeFromPredecessors(BasicBlock *BB,
// [ end ] // [ end ]
// //
SmallVector<BasicBlock*,4> UnconditionalPreds; SmallVector<BasicBlock*,4> UnconditionalPreds;
bool AllPredsAreUnconditional = false; bool HaveNonUnconditionalPredecessors = false;
for (auto *PredBB : predecessors(BB)) { for (auto *PredBB : predecessors(BB)) {
auto *PredBr = dyn_cast<BranchInst>(PredBB->getTerminator()); auto *PredBr = dyn_cast<BranchInst>(PredBB->getTerminator());
if (PredBr && PredBr->isUnconditional()) if (PredBr && PredBr->isUnconditional())
UnconditionalPreds.push_back(PredBB); UnconditionalPreds.push_back(PredBB);
else else
AllPredsAreUnconditional = true; HaveNonUnconditionalPredecessors = true;
} }
if (UnconditionalPreds.size() < 2) if (UnconditionalPreds.size() < 2)
return false; return false;
@ -2061,7 +2061,7 @@ static bool SinkCommonCodeFromPredecessors(BasicBlock *BB,
bool Changed = false; bool Changed = false;
if (AllPredsAreUnconditional) { if (HaveNonUnconditionalPredecessors) {
// It is always legal to sink common instructions from unconditional // It is always legal to sink common instructions from unconditional
// predecessors. However, if not all predecessors are unconditional, // predecessors. However, if not all predecessors are unconditional,
// this transformation might be pessimizing. So as a rule of thumb, // this transformation might be pessimizing. So as a rule of thumb,