mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
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:
parent
d4bf3c2fd6
commit
48d8a70d22
@ -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());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user