diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-12 09:17:50 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-12 09:17:50 +0000 |
commit | 1ac0ab08505f861bd9b3d8f91c845b0a452c9752 (patch) | |
tree | 1ba45aff7fac618c763d4f3046383c34b2f79ba6 /llvm/lib/Analysis/ScalarEvolution.cpp | |
parent | 41cb269a2b1e3e05c34f331964a51881bbaf232c (diff) | |
download | bcm5719-llvm-1ac0ab08505f861bd9b3d8f91c845b0a452c9752.tar.gz bcm5719-llvm-1ac0ab08505f861bd9b3d8f91c845b0a452c9752.zip |
Get even more accurate on the casting.
llvm-svn: 32478
Diffstat (limited to 'llvm/lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | llvm/lib/Analysis/ScalarEvolution.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp index 703a1c46e9a..46b8f2629c3 100644 --- a/llvm/lib/Analysis/ScalarEvolution.cpp +++ b/llvm/lib/Analysis/ScalarEvolution.cpp @@ -1567,8 +1567,7 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) { ConstantInt *CompVal = RHSC->getValue(); const Type *RealTy = ExitCond->getOperand(0)->getType(); CompVal = dyn_cast<ConstantInt>( - ConstantExpr::getIntegerCast(CompVal, RealTy, - CompVal->getType()->isSigned())); + ConstantExpr::getBitCast(CompVal, RealTy)); if (CompVal) { // Form the constant range. ConstantRange CompRange(Cond, CompVal); @@ -1577,12 +1576,10 @@ SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) { // range. if (CompRange.getLower()->getType()->isSigned()) { const Type *NewTy = RHSC->getValue()->getType(); - Constant *NewL = - ConstantExpr::getIntegerCast(CompRange.getLower(), NewTy, - CompRange.getLower()->getType()->isSigned()); - Constant *NewU = - ConstantExpr::getIntegerCast(CompRange.getUpper(), NewTy, - CompRange.getUpper()->getType()->isSigned()); + Constant *NewL = ConstantExpr::getBitCast(CompRange.getLower(), + NewTy); + Constant *NewU = ConstantExpr::getBitCast(CompRange.getUpper(), + NewTy); CompRange = ConstantRange(NewL, NewU); } |