diff options
author | Haicheng Wu <haicheng@codeaurora.org> | 2016-12-20 20:23:48 +0000 |
---|---|---|
committer | Haicheng Wu <haicheng@codeaurora.org> | 2016-12-20 20:23:48 +0000 |
commit | b29dd0107ccda6a94697c91fcc299e79a30c1edb (patch) | |
tree | 3b549e2b54332777b19ca56f1093a0f84fdc1509 /llvm/lib/Transforms/Utils | |
parent | d03df8145f3b84d51dcb0c37053bfb7dbb69669f (diff) | |
download | bcm5719-llvm-b29dd0107ccda6a94697c91fcc299e79a30c1edb.tar.gz bcm5719-llvm-b29dd0107ccda6a94697c91fcc299e79a30c1edb.zip |
[LoopUnroll] Modify a comment to clarify the usage of TripCount. NFC.
Make it clear that TripCount is the upper bound of the iteration on which
control exits LatchBlock.
Differential Revision: https://reviews.llvm.org/D26675
llvm-svn: 290199
Diffstat (limited to 'llvm/lib/Transforms/Utils')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnroll.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index fb74505518e..553a2049ae5 100644 --- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp +++ b/llvm/lib/Transforms/Utils/LoopUnroll.cpp @@ -178,14 +178,14 @@ static bool needToInsertPhisForLCSSA(Loop *L, std::vector<BasicBlock *> Blocks, /// branch instruction. However, if the trip count (and multiple) are not known, /// loop unrolling will mostly produce more code that is no faster. /// -/// TripCount is generally defined as the number of times the loop header -/// executes. UnrollLoop relaxes the definition to permit early exits: here -/// TripCount is the iteration on which control exits LatchBlock if no early -/// exits were taken. Note that UnrollLoop assumes that the loop counter test -/// terminates LatchBlock in order to remove unnecesssary instances of the -/// test. In other words, control may exit the loop prior to TripCount -/// iterations via an early branch, but control may not exit the loop from the -/// LatchBlock's terminator prior to TripCount iterations. +/// TripCount is the upper bound of the iteration on which control exits +/// LatchBlock. Control may exit the loop prior to TripCount iterations either +/// via an early branch in other loop block or via LatchBlock terminator. This +/// is relaxed from the general definition of trip count which is the number of +/// times the loop header executes. Note that UnrollLoop assumes that the loop +/// counter test is in LatchBlock in order to remove unnecesssary instances of +/// the test. If control can exit the loop from the LatchBlock's terminator +/// prior to TripCount iterations, flag PreserveCondBr needs to be set. /// /// PreserveCondBr indicates whether the conditional branch of the LatchBlock /// needs to be preserved. It is needed when we use trip count upper bound to |