summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ScalarEvolution.cpp
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
commit534d66a426c9c97802a18815c01433d8695c2b2b (patch)
tree8e6e2d3ac36fa922f6c0dca81f6f37c3106b0744 /llvm/lib/Analysis/ScalarEvolution.cpp
parentb7e6a3f527aff5871b2ee0803ea71d3f58a05f84 (diff)
downloadbcm5719-llvm-534d66a426c9c97802a18815c01433d8695c2b2b.tar.gz
bcm5719-llvm-534d66a426c9c97802a18815c01433d8695c2b2b.zip
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. llvm-svn: 77078
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 49af5793662..6592e0d0778 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/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),
OpenPOWER on IntegriCloud