diff options
author | Andrew Trick <atrick@apple.com> | 2011-07-25 22:17:47 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2011-07-25 22:17:47 +0000 |
commit | 478849e98ca4661d77c1d6f3f96e8b28e1183fbd (patch) | |
tree | f18e0d081b90cc3fbab23062cb7598c2edd6ccfd /lib/Transforms/Utils/LoopUnroll.cpp | |
parent | 617793d1d6fa28eb47d4fc04d265a6eace6c758c (diff) |
Add clarifying comments for the new arguments to UnrollLoop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135988 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/LoopUnroll.cpp')
-rw-r--r-- | lib/Transforms/Utils/LoopUnroll.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Transforms/Utils/LoopUnroll.cpp b/lib/Transforms/Utils/LoopUnroll.cpp index 27382c2de9..dddf43ea57 100644 --- a/lib/Transforms/Utils/LoopUnroll.cpp +++ b/lib/Transforms/Utils/LoopUnroll.cpp @@ -106,6 +106,18 @@ static BasicBlock *FoldBlockIntoPredecessor(BasicBlock *BB, LoopInfo* LI) { /// 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. +/// +/// Similarly, TripMultiple divides the number of times that the LatchBlock may +/// execute without exiting the loop. +/// /// The LoopInfo Analysis that is passed will be kept consistent. /// /// If a LoopPassManager is passed in, and the loop is fully removed, it will be |