diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-05-09 01:08:24 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-05-09 01:08:24 +0000 |
commit | 2d85052f2bae5a5a31c03017c48ca8a9eba1453c (patch) | |
tree | 9449f47cbd211a26be5e3b6b40dbfcdda0b8d6d7 /lib/Transforms/Scalar | |
parent | c63a62735ba8b2e9011d48afde52e4c67df6f902 (diff) | |
download | external_llvm-2d85052f2bae5a5a31c03017c48ca8a9eba1453c.zip external_llvm-2d85052f2bae5a5a31c03017c48ca8a9eba1453c.tar.gz external_llvm-2d85052f2bae5a5a31c03017c48ca8a9eba1453c.tar.bz2 |
Factor out code that optimize loop terminating condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71305 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index f441968..8d3240e 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -164,8 +164,11 @@ namespace { ICmpInst *ChangeCompareStride(Loop *L, ICmpInst *Cond, IVStrideUse* &CondUse, const SCEVHandle* &CondStride); + void OptimizeIndvars(Loop *L); + void OptimizeLoopTermCond(Loop *L); + /// OptimizeShadowIV - If IV is used in a int-to-float cast /// inside the loop then try to eliminate the cast opeation. void OptimizeShadowIV(Loop *L); @@ -2378,6 +2381,12 @@ void LoopStrengthReduce::OptimizeIndvars(Loop *L) { OptimizeShadowIV(L); + OptimizeLoopTermCond(L); +} + +/// OptimizeLoopTermCond - Change loop terminating condition to use the +/// postinc iv when possible. +void LoopStrengthReduce::OptimizeLoopTermCond(Loop *L) { // Finally, get the terminating condition for the loop if possible. If we // can, we want to change it to use a post-incremented version of its // induction variable, to allow coalescing the live ranges for the IV into |