aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-25 16:03:30 +0000
committerDan Gohman <gohman@apple.com>2009-07-25 16:03:30 +0000
commit0658f6118c14ea919ad55e7207f80e2228c34454 (patch)
treeeac473b3357be97753f3d02e114d548da4d3e2f9 /lib
parent51d5234254d2b068b0b261a3597685d2251e30f5 (diff)
downloadexternal_llvm-0658f6118c14ea919ad55e7207f80e2228c34454.zip
external_llvm-0658f6118c14ea919ad55e7207f80e2228c34454.tar.gz
external_llvm-0658f6118c14ea919ad55e7207f80e2228c34454.tar.bz2
When attempting to sign-extend an addrec by interpreting
the step value as unsigned, the start value and the addrec itself still need to be treated as signed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77078 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 49af579..6592e0d 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -923,10 +923,10 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
getTruncateOrZeroExtend(Step, Start->getType()));
Add = getAddExpr(Start, UMul);
OperandExtendedAdd =
- getAddExpr(getZeroExtendExpr(Start, WideTy),
+ getAddExpr(getSignExtendExpr(Start, WideTy),
getMulExpr(getZeroExtendExpr(CastedMaxBECount, WideTy),
getZeroExtendExpr(Step, WideTy)));
- if (getZeroExtendExpr(Add, WideTy) == OperandExtendedAdd)
+ if (getSignExtendExpr(Add, WideTy) == OperandExtendedAdd)
// Return the expression with the addrec on the outside.
return getAddRecExpr(getSignExtendExpr(Start, Ty),
getZeroExtendExpr(Step, Ty),