mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
When creating cast scevs, canonicalize the destination type. This
avoids duplicate scevs that differ only in type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70549 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
fbccdef106
commit
10b9479f55
@ -649,6 +649,9 @@ SCEVHandle SCEVAddRecExpr::evaluateAtIteration(SCEVHandle It,
|
||||
SCEVHandle ScalarEvolution::getTruncateExpr(const SCEVHandle &Op, const Type *Ty) {
|
||||
assert(getTypeSizeInBits(Op->getType()) > getTypeSizeInBits(Ty) &&
|
||||
"This is not a truncating conversion!");
|
||||
assert(isSCEVable(Ty) &&
|
||||
"This is not a conversion to a SCEVable type!");
|
||||
Ty = getEffectiveSCEVType(Ty);
|
||||
|
||||
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
||||
return getUnknown(
|
||||
@ -689,6 +692,9 @@ SCEVHandle ScalarEvolution::getZeroExtendExpr(const SCEVHandle &Op,
|
||||
const Type *Ty) {
|
||||
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
|
||||
"This is not an extending conversion!");
|
||||
assert(isSCEVable(Ty) &&
|
||||
"This is not a conversion to a SCEVable type!");
|
||||
Ty = getEffectiveSCEVType(Ty);
|
||||
|
||||
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
||||
const Type *IntTy = getEffectiveSCEVType(Ty);
|
||||
@ -771,6 +777,9 @@ SCEVHandle ScalarEvolution::getSignExtendExpr(const SCEVHandle &Op,
|
||||
const Type *Ty) {
|
||||
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
|
||||
"This is not an extending conversion!");
|
||||
assert(isSCEVable(Ty) &&
|
||||
"This is not a conversion to a SCEVable type!");
|
||||
Ty = getEffectiveSCEVType(Ty);
|
||||
|
||||
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
||||
const Type *IntTy = getEffectiveSCEVType(Ty);
|
||||
|
Loading…
Reference in New Issue
Block a user