[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:
Craig Topper 2018-05-10 00:53:25 +00:00
parent 333efc951a
commit 553d451e95
1 changed files with 3 additions and 3 deletions

View File

@ -393,9 +393,9 @@ static bool canEvaluateTruncated(Value *V, Type *Ty, InstCombiner &IC,
if (match(I->getOperand(1), m_APInt(Amt))) { if (match(I->getOperand(1), m_APInt(Amt))) {
uint32_t OrigBitWidth = OrigTy->getScalarSizeInBits(); uint32_t OrigBitWidth = OrigTy->getScalarSizeInBits();
uint32_t BitWidth = Ty->getScalarSizeInBits(); uint32_t BitWidth = Ty->getScalarSizeInBits();
if (IC.MaskedValueIsZero(I->getOperand(0), if (Amt->getLimitedValue(BitWidth) < BitWidth &&
APInt::getBitsSetFrom(OrigBitWidth, BitWidth), 0, CxtI) && IC.MaskedValueIsZero(I->getOperand(0),
Amt->getLimitedValue(BitWidth) < BitWidth) { APInt::getBitsSetFrom(OrigBitWidth, BitWidth), 0, CxtI)) {
return canEvaluateTruncated(I->getOperand(0), Ty, IC, CxtI); return canEvaluateTruncated(I->getOperand(0), Ty, IC, CxtI);
} }
} }