aboutsummaryrefslogtreecommitdiff
path: root/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--lib/Transforms/Scalar/LoopStrengthReduce.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index 4f18637c9f..f170592ece 100644
--- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/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;
}