summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-12-05 18:23:57 +0000
committerChris Lattner <sabre@nondot.org>2005-12-05 18:23:57 +0000
commit077200737cc3d01d58d4e78de37a97e313a510a9 (patch)
tree23cc4c550377978e35e6bd1072bdea6390c20453 /llvm/lib/Transforms
parent9410433966818f69b4e88ae53904bd02eaf08a82 (diff)
downloadbcm5719-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.cpp6
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;
}
OpenPOWER on IntegriCloud