forked from OSchip/llvm-project
minor simplification to code: Ty is already a SCEV type; don't need to run getEffectiveSCEVType() twice
llvm-svn: 156823
This commit is contained in:
parent
c9fd917b36
commit
ab5c924006
|
@ -826,8 +826,7 @@ const SCEV *ScalarEvolution::getTruncateExpr(const SCEV *Op,
|
|||
// Fold if the operand is constant.
|
||||
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
||||
return getConstant(
|
||||
cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(),
|
||||
getEffectiveSCEVType(Ty))));
|
||||
cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(), Ty)));
|
||||
|
||||
// trunc(trunc(x)) --> trunc(x)
|
||||
if (const SCEVTruncateExpr *ST = dyn_cast<SCEVTruncateExpr>(Op))
|
||||
|
@ -906,8 +905,7 @@ const SCEV *ScalarEvolution::getZeroExtendExpr(const SCEV *Op,
|
|||
// Fold if the operand is constant.
|
||||
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
||||
return getConstant(
|
||||
cast<ConstantInt>(ConstantExpr::getZExt(SC->getValue(),
|
||||
getEffectiveSCEVType(Ty))));
|
||||
cast<ConstantInt>(ConstantExpr::getZExt(SC->getValue(), Ty)));
|
||||
|
||||
// zext(zext(x)) --> zext(x)
|
||||
if (const SCEVZeroExtendExpr *SZ = dyn_cast<SCEVZeroExtendExpr>(Op))
|
||||
|
@ -1164,8 +1162,7 @@ const SCEV *ScalarEvolution::getSignExtendExpr(const SCEV *Op,
|
|||
// Fold if the operand is constant.
|
||||
if (const SCEVConstant *SC = dyn_cast<SCEVConstant>(Op))
|
||||
return getConstant(
|
||||
cast<ConstantInt>(ConstantExpr::getSExt(SC->getValue(),
|
||||
getEffectiveSCEVType(Ty))));
|
||||
cast<ConstantInt>(ConstantExpr::getSExt(SC->getValue(), Ty)));
|
||||
|
||||
// sext(sext(x)) --> sext(x)
|
||||
if (const SCEVSignExtendExpr *SS = dyn_cast<SCEVSignExtendExpr>(Op))
|
||||
|
|
Loading…
Reference in New Issue