summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-06-24 16:33:38 +0000
committerDan Gohman <gohman@apple.com>2010-06-24 16:33:38 +0000
commit3ace9f4e3d85ceb3638ca55c5ab37180c7f73d2c (patch)
tree10ec2886a1bb92d50abead390abddb633ab89a0e /llvm
parent3f9ceb7916bc5c079f133f5522e14b2c41adf2c7 (diff)
downloadbcm5719-llvm-3ace9f4e3d85ceb3638ca55c5ab37180c7f73d2c.tar.gz
bcm5719-llvm-3ace9f4e3d85ceb3638ca55c5ab37180c7f73d2c.zip
Make the trunc code consistent with the zext and sext code in its
handling of pointer types. llvm-svn: 106757
Diffstat (limited to 'llvm')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 2a18ab449a1..24354d40282 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -822,7 +822,8 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCEV *Op,
// Fold if the operand is constant.
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
return getConstant(
- cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(), Ty)));
+ cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(),
+ getEffectiveSCEVType(Ty))));
// trunc(trunc(x)) --> trunc(x)
if (const SCEVTruncateExpr *ST = dyn_cast<SCEVTruncateExpr>(Op))
OpenPOWER on IntegriCloud