forked from OSchip/llvm-project
[InstCombine] Reorder an if condition to put a cheap check in front of a computeKnownBits call. NFC
llvm-svn: 331948
This commit is contained in:
parent
333efc951a
commit
553d451e95
|
@ -393,9 +393,9 @@ static bool canEvaluateTruncated(Value *V, Type *Ty, InstCombiner &IC,
|
|||
if (match(I->getOperand(1), m_APInt(Amt))) {
|
||||
uint32_t OrigBitWidth = OrigTy->getScalarSizeInBits();
|
||||
uint32_t BitWidth = Ty->getScalarSizeInBits();
|
||||
if (IC.MaskedValueIsZero(I->getOperand(0),
|
||||
APInt::getBitsSetFrom(OrigBitWidth, BitWidth), 0, CxtI) &&
|
||||
Amt->getLimitedValue(BitWidth) < BitWidth) {
|
||||
if (Amt->getLimitedValue(BitWidth) < BitWidth &&
|
||||
IC.MaskedValueIsZero(I->getOperand(0),
|
||||
APInt::getBitsSetFrom(OrigBitWidth, BitWidth), 0, CxtI)) {
|
||||
return canEvaluateTruncated(I->getOperand(0), Ty, IC, CxtI);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue