forked from OSchip/llvm-project
Make the trunc code consistent with the zext and sext code in its
handling of pointer types. llvm-svn: 106757
This commit is contained in:
parent
3f9ceb7916
commit
3ace9f4e3d
|
@ -822,7 +822,8 @@ 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(), Ty)));
|
||||
cast<ConstantInt>(ConstantExpr::getTrunc(SC->getValue(),
|
||||
getEffectiveSCEVType(Ty))));
|
||||
|
||||
// trunc(trunc(x)) --> trunc(x)
|
||||
if (const SCEVTruncateExpr *ST = dyn_cast<SCEVTruncateExpr>(Op))
|
||||
|
|
Loading…
Reference in New Issue