From 707ad0139988a1782e63bc1331785b459f30baf5 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Thu, 29 Apr 2021 01:23:44 +0300 Subject: [PATCH] [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. --- llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 0704c5f2321a..2369935236a6 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -1988,13 +1988,13 @@ static bool SinkCommonCodeFromPredecessors(BasicBlock *BB, // [ end ] // SmallVector UnconditionalPreds; - bool AllPredsAreUnconditional = false; + bool HaveNonUnconditionalPredecessors = false; for (auto *PredBB : predecessors(BB)) { auto *PredBr = dyn_cast(PredBB->getTerminator()); if (PredBr && PredBr->isUnconditional()) UnconditionalPreds.push_back(PredBB); else - AllPredsAreUnconditional = true; + HaveNonUnconditionalPredecessors = true; } if (UnconditionalPreds.size() < 2) return false; @@ -2061,7 +2061,7 @@ static bool SinkCommonCodeFromPredecessors(BasicBlock *BB, bool Changed = false; - if (AllPredsAreUnconditional) { + if (HaveNonUnconditionalPredecessors) { // It is always legal to sink common instructions from unconditional // predecessors. However, if not all predecessors are unconditional, // this transformation might be pessimizing. So as a rule of thumb,