mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-04-07 02:01:43 +00:00
When creating cast scevs, canonicalize the destination type. This
avoids duplicate scevs that differ only in type. llvm-svn: 70549
This commit is contained in:
parent
908d546da3
commit
24b592972d
@ -649,6 +649,9 @@ SCEVHandle SCEVAddRecExpr::evaluateAtIteration(SCEVHandle It,
|
|||||||
SCEVHandle ScalarEvolution::getTruncateExpr(const SCEVHandle &Op, const Type *Ty) {
|
SCEVHandle ScalarEvolution::getTruncateExpr(const SCEVHandle &Op, const Type *Ty) {
|
||||||
assert(getTypeSizeInBits(Op->getType()) > getTypeSizeInBits(Ty) &&
|
assert(getTypeSizeInBits(Op->getType()) > getTypeSizeInBits(Ty) &&
|
||||||
"This is not a truncating conversion!");
|
"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))
|
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
||||||
return getUnknown(
|
return getUnknown(
|
||||||
@ -689,6 +692,9 @@ SCEVHandle ScalarEvolution::getZeroExtendExpr(const SCEVHandle &Op,
|
|||||||
const Type *Ty) {
|
const Type *Ty) {
|
||||||
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
|
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
|
||||||
"This is not an extending conversion!");
|
"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)) {
|
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
||||||
const Type *IntTy = getEffectiveSCEVType(Ty);
|
const Type *IntTy = getEffectiveSCEVType(Ty);
|
||||||
@ -771,6 +777,9 @@ SCEVHandle ScalarEvolution::getSignExtendExpr(const SCEVHandle &Op,
|
|||||||
const Type *Ty) {
|
const Type *Ty) {
|
||||||
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
|
assert(getTypeSizeInBits(Op->getType()) < getTypeSizeInBits(Ty) &&
|
||||||
"This is not an extending conversion!");
|
"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)) {
|
if (SCEVConstant *SC = dyn_cast<SCEVConstant>(Op)) {
|
||||||
const Type *IntTy = getEffectiveSCEVType(Ty);
|
const Type *IntTy = getEffectiveSCEVType(Ty);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user