From: Max Kazantsev Date: Tue, 27 Mar 2018 08:13:55 +0000 (+0000) Subject: [NFC] Fix comments in getExact() X-Git-Tag: android-x86-7.1-r4~3146 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=0048092b9c81364560c32a54e3c81d222393be37;p=android-x86%2Fexternal-llvm.git [NFC] Fix comments in getExact() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@328612 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 3a1c6fbd408..2b96b989a80 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -6648,13 +6648,11 @@ void ScalarEvolution::forgetValue(Value *V) { } /// Get the exact loop backedge taken count considering all loop exits. A -/// computable result can only be returned for loops with a single exit. -/// Returning the minimum taken count among all exits is incorrect because one -/// of the loop's exit limit's may have been skipped. howFarToZero assumes that -/// the limit of each loop test is never skipped. This is a valid assumption as -/// long as the loop exits via that test. For precise results, it is the -/// caller's responsibility to specify the relevant loop exit using -/// getExact(ExitingBlock, SE). +/// computable result can only be returned for loops with all exiting blocks +/// dominating the latch. howFarToZero assumes that the limit of each loop test +/// is never skipped. This is a valid assumption as long as the loop exits via +/// that test. For precise results, it is the caller's responsibility to specify +/// the relevant loop exiting block using getExact(ExitingBlock, SE). const SCEV * ScalarEvolution::BackedgeTakenInfo::getExact(const Loop *L, ScalarEvolution *SE, SCEVUnionPredicate *Preds) const { @@ -6664,16 +6662,17 @@ ScalarEvolution::BackedgeTakenInfo::getExact(const Loop *L, ScalarEvolution *SE, const SCEV *BECount = nullptr; const BasicBlock *Latch = L->getLoopLatch(); - // All exits we have collected must dominate the only latch. + // All exiting blocks we have collected must dominate the only backedge. if (!Latch) return SE->getCouldNotCompute(); - // All exits we have gathered dominate loop's latch, so exact trip count is - // simply a minimum out of all these calculated exit counts. + // All exiting blocks we have gathered dominate loop's latch, so exact trip + // count is simply a minimum out of all these calculated exit counts. for (auto &ENT : ExitNotTaken) { - assert(ENT.ExactNotTaken != SE->getCouldNotCompute() && "bad exit SCEV"); + assert(ENT.ExactNotTaken != SE->getCouldNotCompute() && "Bad exit SCEV!"); assert(SE->DT.dominates(ENT.ExitingBlock, Latch) && - "We should only have known counts for exits that dominate latch!"); + "We should only have known counts for exiting blocks that dominate " + "latch!"); if (!BECount) BECount = ENT.ExactNotTaken;