Delete code for folding undefs in ScalarEvolution. It's invalid in

obscure ways, and it isn't actually important in the real world.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159969 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dan Gohman 2012-07-09 23:51:20 +00:00
parent 270e3625b2
commit 655b5a48b9

View File

@ -878,13 +878,6 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCEV *Op,
return getAddRecExpr(Operands, AddRec->getLoop(), SCEV::FlagAnyWrap); return getAddRecExpr(Operands, AddRec->getLoop(), SCEV::FlagAnyWrap);
} }
// As a special case, fold trunc(undef) to undef. We don't want to
// know too much about SCEVUnknowns, but this special case is handy
// and harmless.
if (const SCEVUnknown *U = dyn_cast<SCEVUnknown>(Op))
if (isa<UndefValue>(U->getValue()))
return getSCEV(UndefValue::get(Ty));
// The cast wasn't folded; create an explicit cast node. We can reuse // The cast wasn't folded; create an explicit cast node. We can reuse
// the existing insert position since if we get here, we won't have // the existing insert position since if we get here, we won't have
// made any changes which would invalidate it. // made any changes which would invalidate it.
@ -1344,13 +1337,6 @@ const SCEV *ScalarEvolution::getAnyExtendExpr(const SCEV *Op,
return getAddRecExpr(Ops, AR->getLoop(), SCEV::FlagNW); return getAddRecExpr(Ops, AR->getLoop(), SCEV::FlagNW);
} }
// As a special case, fold anyext(undef) to undef. We don't want to
// know too much about SCEVUnknowns, but this special case is handy
// and harmless.
if (const SCEVUnknown *U = dyn_cast<SCEVUnknown>(Op))
if (isa<UndefValue>(U->getValue()))
return getSCEV(UndefValue::get(Ty));
// If the expression is obviously signed, use the sext cast value. // If the expression is obviously signed, use the sext cast value.
if (isa<SCEVSMaxExpr>(Op)) if (isa<SCEVSMaxExpr>(Op))
return SExt; return SExt;