forked from OSchip/llvm-project
[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:
parent
e20b32ff3b
commit
707ad01399
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue