summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-12 05:05:00 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-12 05:05:00 +0000
commitb341b0861dcfdfd4453b32169a86302a275b81c9 (patch)
treec407db06dc5ffde18fc136ce1a87da9ede9f33c2 /llvm/lib/Analysis
parent6e5fe376ec898e651526107485d2a0f6e4000789 (diff)
downloadbcm5719-llvm-b341b0861dcfdfd4453b32169a86302a275b81c9.tar.gz
bcm5719-llvm-b341b0861dcfdfd4453b32169a86302a275b81c9.zip
Change inferred getCast into specific getCast. Passes all tests.
llvm-svn: 32469
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 6d449d0d92b..703a1c46e9a 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -1566,7 +1566,9 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) {
// comparison.
ConstantInt *CompVal = RHSC->getValue();
const Type *RealTy = ExitCond->getOperand(0)->getType();
- CompVal = dyn_cast<ConstantInt>(ConstantExpr::getCast(CompVal, RealTy));
+ CompVal = dyn_cast<ConstantInt>(
+ ConstantExpr::getIntegerCast(CompVal, RealTy,
+ CompVal->getType()->isSigned()));
if (CompVal) {
// Form the constant range.
ConstantRange CompRange(Cond, CompVal);
@@ -1575,8 +1577,12 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) {
// range.
if (CompRange.getLower()->getType()->isSigned()) {
const Type *NewTy = RHSC->getValue()->getType();
- Constant *NewL = ConstantExpr::getCast(CompRange.getLower(), NewTy);
- Constant *NewU = ConstantExpr::getCast(CompRange.getUpper(), NewTy);
+ Constant *NewL =
+ ConstantExpr::getIntegerCast(CompRange.getLower(), NewTy,
+ CompRange.getLower()->getType()->isSigned());
+ Constant *NewU =
+ ConstantExpr::getIntegerCast(CompRange.getUpper(), NewTy,
+ CompRange.getUpper()->getType()->isSigned());
CompRange = ConstantRange(NewL, NewU);
}
OpenPOWER on IntegriCloud