diff options
author | Chris Lattner <sabre@nondot.org> | 2005-12-05 18:23:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-12-05 18:23:57 +0000 |
commit | 077200737cc3d01d58d4e78de37a97e313a510a9 (patch) | |
tree | 23cc4c550377978e35e6bd1072bdea6390c20453 /llvm/lib/Transforms | |
parent | 9410433966818f69b4e88ae53904bd02eaf08a82 (diff) | |
download | bcm5719-llvm-077200737cc3d01d58d4e78de37a97e313a510a9.tar.gz bcm5719-llvm-077200737cc3d01d58d4e78de37a97e313a510a9.zip |
getRawValue zero extens for unsigned values, use getsextvalue so that we
know that small negative values fit into the immediate field of addressing
modes.
llvm-svn: 24608
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 4f18637c9f6..f170592ece3 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -560,9 +560,9 @@ static bool isTargetConstant(const SCEVHandle &V) { // FIXME: Look at the target to decide if &GV is a legal constant immediate. if (SCEVConstant *SC = dyn_cast<SCEVConstant>(V)) { // PPC allows a sign-extended 16-bit immediate field. - if ((int64_t)SC->getValue()->getRawValue() > -(1 << 16) && - (int64_t)SC->getValue()->getRawValue() < (1 << 16)-1) - return true; + int64_t V = SC->getValue()->getSExtValue(); + if (V > -(1 << 16) && V < (1 << 16)-1) + return true; return false; } |