projects
/
oota-llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9d87f4
)
Make sure to use signed arithmetic in APInt to fix a regression.
author
David Greene
<greened@obbligato.org>
Wed, 6 May 2009 17:39:26 +0000
(17:39 +0000)
committer
David Greene
<greened@obbligato.org>
Wed, 6 May 2009 17:39:26 +0000
(17:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71090
91177308
-0d34-0410-b5e6-
96231b3b80d8
lib/Transforms/Scalar/LoopStrengthReduce.cpp
patch
|
blob
|
history
diff --git
a/lib/Transforms/Scalar/LoopStrengthReduce.cpp
b/lib/Transforms/Scalar/LoopStrengthReduce.cpp
index e2cbbc2d27052ed3cc4395eff196eba9d45b9353..9e6f2b02bc8cbd8842886d83bf3dbd5fa7ff13cc 100644
(file)
--- a/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
+++ b/
lib/Transforms/Scalar/LoopStrengthReduce.cpp
@@
-2027,9
+2027,10
@@
ICmpInst *LoopStrengthReduce::ChangeCompareStride(Loop *L, ICmpInst *Cond,
Scale = SSInt / CmpSSInt;
int64_t NewCmpVal = CmpVal * Scale;
- APInt Mul = APInt(BitWidth, NewCmpVal);
+ APInt Mul = APInt(BitWidth*2, CmpVal, true);
+ Mul = Mul * APInt(BitWidth*2, Scale, true);
// Check for overflow.
- if (
Mul.getSExtValue() != NewCmpVal)
+ if (
!Mul.isSignedIntN(BitWidth)) {
continue;
// Watch out for overflow.