[llvm] 7873376 - [LoopUnroll] Fix build failure for allyesconfig.
Whitney Tsang via llvm-commits
llvm-commits at lists.llvm.org
Sat May 30 11:41:49 PDT 2020
Author: Whitney Tsang
Date: 2020-05-30T18:32:47Z
New Revision: 7873376bb36b4f9646fbc26d6da88e2edbf796e4
URL: https://github.com/llvm/llvm-project/commit/7873376bb36b4f9646fbc26d6da88e2edbf796e4
DIFF: https://github.com/llvm/llvm-project/commit/7873376bb36b4f9646fbc26d6da88e2edbf796e4.diff
LOG: [LoopUnroll] Fix build failure for allyesconfig.
Differential Revision: https://reviews.llvm.org/D80477.
Added:
Modified:
llvm/lib/Transforms/Utils/LoopUnroll.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
index 06e9f7ff2f53..861fc7d46ffe 100644
--- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp
@@ -818,10 +818,10 @@ LoopUnrollResult llvm::UnrollLoop(Loop *L, UnrollLoopOptions ULO, LoopInfo *LI,
// For loops exiting from non latch exiting block, we limit the
// supported loops to have a single exiting block.
NewIDom = TermBlocks.back();
- for (BasicBlock *Iter : TermBlocks) {
- Instruction *Term = Iter->getTerminator();
+ for (unsigned i = 0, e = TermBlocks.size(); i != e; ++i) {
+ Instruction *Term = TermBlocks[i]->getTerminator();
if (isa<BranchInst>(Term) && cast<BranchInst>(Term)->isConditional()) {
- NewIDom = Iter;
+ NewIDom = DT->findNearestCommonDominator(TermBlocks[i], Latches[i]);
break;
}
}
More information about the llvm-commits
mailing list