From: Whitney Tsang Date: Sat, 30 May 2020 18:20:23 +0000 (+0000) Subject: [LoopUnroll] Fix build failure for allyesconfig. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7873376bb36b4f9646fbc26d6da88e2edbf796e4;p=platform%2Fupstream%2Fllvm.git [LoopUnroll] Fix build failure for allyesconfig. Differential Revision: https://reviews.llvm.org/D80477. --- diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index 06e9f7f..861fc7d 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(Term) && cast(Term)->isConditional()) { - NewIDom = Iter; + NewIDom = DT->findNearestCommonDominator(TermBlocks[i], Latches[i]); break; } }