mirror of
https://github.com/RPCSX/llvm.git
synced 2025-01-05 03:10:29 +00:00
[ValueTracking] Use APInt::sext instead of zext and setBitsFrom. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300307 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
d62c8b3151
commit
24f1072151
@ -1078,15 +1078,10 @@ static void computeKnownBitsFromOperator(const Operator *I, APInt &KnownZero,
|
||||
KnownZero = KnownZero.trunc(SrcBitWidth);
|
||||
KnownOne = KnownOne.trunc(SrcBitWidth);
|
||||
computeKnownBits(I->getOperand(0), KnownZero, KnownOne, Depth + 1, Q);
|
||||
KnownZero = KnownZero.zext(BitWidth);
|
||||
KnownOne = KnownOne.zext(BitWidth);
|
||||
|
||||
// If the sign bit of the input is known set or clear, then we know the
|
||||
// top bits of the result.
|
||||
if (KnownZero[SrcBitWidth-1]) // Input sign bit known zero
|
||||
KnownZero.setBitsFrom(SrcBitWidth);
|
||||
else if (KnownOne[SrcBitWidth-1]) // Input sign bit known set
|
||||
KnownOne.setBitsFrom(SrcBitWidth);
|
||||
KnownZero = KnownZero.sext(BitWidth);
|
||||
KnownOne = KnownOne.sext(BitWidth);
|
||||
break;
|
||||
}
|
||||
case Instruction::Shl: {
|
||||
|
Loading…
Reference in New Issue
Block a user