Make ScalarEvolution actually use a ZeroExtend expression instead of

having SCZeroExtendExpr be equivalent to SCTruncate


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31355 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2006-11-01 21:53:12 +00:00
parent d4bf3c2fd6
commit 48d8a70d22

View File

@ -229,7 +229,7 @@ static ManagedStatic<std::map<std::pair<SCEV*, const Type*>,
SCEVZeroExtendExpr*> > SCEVZeroExtends;
SCEVZeroExtendExpr::SCEVZeroExtendExpr(const SCEVHandle &op, const Type *ty)
: SCEV(scTruncate), Op(op), Ty(ty) {
: SCEV(scZeroExtend), Op(op), Ty(ty) {
assert(Op->getType()->isInteger() && Ty->isInteger() &&
Ty->isUnsigned() &&
"Cannot zero extend non-integer value!");
@ -1359,7 +1359,7 @@ SCEVHandle ScalarEvolutionsImpl::createNodeForCast(CastInst *CI) {
return SCEVTruncateExpr::get(getSCEV(CI->getOperand(0)),
CI->getType()->getUnsignedVersion());
if (SrcTy->isUnsigned() &&
SrcTy->getPrimitiveSize() > DestTy->getPrimitiveSize())
SrcTy->getPrimitiveSize() <= DestTy->getPrimitiveSize())
return SCEVZeroExtendExpr::get(getSCEV(CI->getOperand(0)),
CI->getType()->getUnsignedVersion());
}