[ConstantRange] Delete redundnt {z,s}extOrSelf for multiplication

These calls are redundant because the quotients have the same BitWidth
as MinValue/MaxValue.

llvm-svn: 357886
This commit is contained in:
Fangrui Song 2019-04-08 07:29:24 +00:00
parent 4af8d47d05
commit dc1f4a6764
1 changed files with 0 additions and 7 deletions

View File

@ -314,13 +314,6 @@ ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp,
Lower = APIntOps::RoundingSDiv(MinValue, V, APInt::Rounding::UP);
Upper = APIntOps::RoundingSDiv(MaxValue, V, APInt::Rounding::DOWN);
}
if (Unsigned) {
Lower = Lower.zextOrSelf(BitWidth);
Upper = Upper.zextOrSelf(BitWidth);
} else {
Lower = Lower.sextOrSelf(BitWidth);
Upper = Upper.sextOrSelf(BitWidth);
}
// ConstantRange ctor take a half inclusive interval [Lower, Upper + 1).
// Upper + 1 is guanranteed not to overflow, because |divisor| > 1. 0, -1,
// and 1 are already handled as special cases.