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 | 990f771a9a5285172cd42c7d2c57f4ed94f6ca5e (patch) | |
tree | 0f2ac4c10a99d9e2da06932509bb93b6e0d00627 | |
parent | 55c8a787162ce32c1dd1d7b80ae87d6ea0b5cd9e (diff) | |
download | bcm5719-llvm-990f771a9a5285172cd42c7d2c57f4ed94f6ca5e.tar.gz bcm5719-llvm-990f771a9a5285172cd42c7d2c57f4ed94f6ca5e.zip |
Add clarifying comments for the new arguments to UnrollLoop.
llvm-svn: 135988
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUnroll.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUnroll.cpp b/llvm/lib/Transforms/Utils/LoopUnroll.cpp index 27382c2de9c..dddf43ea573 100644 --- a/llvm/lib/Transforms/Utils/LoopUnroll.cpp +++ b/llvm/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 |