diff options
| author | Dan Gohman <gohman@apple.com> | 2009-04-16 16:49:48 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-04-16 16:49:48 +0000 |
| commit | 8b6ebb111200965e74ffc3163faf440d7b7d5e7a (patch) | |
| tree | 7e661ef5f89f76d78c1e87dc95e42bcc0823555f /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
| parent | e2ead2c328de54c6756a51c888f8f55539a5bad9 (diff) | |
| download | bcm5719-llvm-8b6ebb111200965e74ffc3163faf440d7b7d5e7a.tar.gz bcm5719-llvm-8b6ebb111200965e74ffc3163faf440d7b7d5e7a.zip | |
Minor code simplifications. Don't attempt LSR on theoretical
targets with pointers larger than 64 bits, due to the code not
yet being APInt clean.
llvm-svn: 69296
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 957582817a4..733f37c2074 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -489,8 +489,7 @@ bool LoopStrengthReduce::AddUsersIfInteresting(Instruction *I, Loop *L, return false; // Void and FP expressions cannot be reduced. // LSR is not APInt clean, do not touch integers bigger than 64-bits. - if (I->getType()->isInteger() && - I->getType()->getPrimitiveSizeInBits() > 64) + if (TD->getTypeSizeInBits(I->getType()) > 64) return false; if (!Processed.insert(I)) @@ -2075,16 +2074,11 @@ ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond, if (RequiresTypeConversion(NewCmpTy, CmpTy)) { // Check if it is possible to rewrite it using // an iv / stride of a smaller integer type. - bool TruncOk = false; - if (NewCmpTy->isInteger()) { - unsigned Bits = NewTyBits; - if (ICmpInst::isSignedPredicate(Predicate)) - --Bits; - uint64_t Mask = (1ULL << Bits) - 1; - if (((uint64_t)NewCmpVal & Mask) == (uint64_t)NewCmpVal) - TruncOk = true; - } - if (!TruncOk) + unsigned Bits = NewTyBits; + if (ICmpInst::isSignedPredicate(Predicate)) + --Bits; + uint64_t Mask = (1ULL << Bits) - 1; + if (((uint64_t)NewCmpVal & Mask) != (uint64_t)NewCmpVal) continue; } |

