diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-08-06 18:04:43 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-08-06 18:04:43 +0000 |
commit | 907dc2bc37f4b82c606cb62f52d0b2f0a9e7d557 (patch) | |
tree | edc0acfa83239f62bccfe82be0e1523998b915eb /llvm/lib | |
parent | 2dd3e4e49df29fa7c66c08fbdb2ad5d152ffd1e7 (diff) | |
download | bcm5719-llvm-907dc2bc37f4b82c606cb62f52d0b2f0a9e7d557.tar.gz bcm5719-llvm-907dc2bc37f4b82c606cb62f52d0b2f0a9e7d557.zip |
Fix PR2355: bug in ChangeCompareStride. When the loop termination compare is the only use of its iv stride, the stride can be eliminated by moving it to another stride. If the scale is negative, swap the predicate instead of using a inverse predicate.
llvm-svn: 54415
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 83bdb2cd176..3d82fd279c5 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -1624,10 +1624,10 @@ ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond, continue; } - // If scale is negative, use inverse predicate unless it's testing + // If scale is negative, use swapped predicate unless it's testing // for equality. if (Scale < 0 && !Cond->isEquality()) - Predicate = ICmpInst::getInversePredicate(Predicate); + Predicate = ICmpInst::getSwappedPredicate(Predicate); NewStride = &StrideOrder[i]; break; |