Skip to content

Commit 4baeed8

Browse files
committed
[InstCombine] Remove unnecessary handling of non-canonical predicates (NFCI)
ule/uge with a constant will be converted to ult/ugt, so there is no need to handle these variants.
1 parent 1d10369 commit 4baeed8

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5906,29 +5906,6 @@ static Instruction *processUMulZExtIdiom(ICmpInst &I, Value *MulVal,
59065906
}
59075907
return nullptr;
59085908

5909-
case ICmpInst::ICMP_UGE:
5910-
// Recognize pattern:
5911-
// mulval = mul(zext A, zext B)
5912-
// cmp uge mulval, max+1
5913-
if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) {
5914-
APInt MaxVal = APInt::getOneBitSet(CI->getBitWidth(), MulWidth);
5915-
if (MaxVal.eq(CI->getValue()))
5916-
break; // Recognized
5917-
}
5918-
return nullptr;
5919-
5920-
case ICmpInst::ICMP_ULE:
5921-
// Recognize pattern:
5922-
// mulval = mul(zext A, zext B)
5923-
// cmp ule mulval, max
5924-
if (ConstantInt *CI = dyn_cast<ConstantInt>(OtherVal)) {
5925-
APInt MaxVal = APInt::getMaxValue(MulWidth);
5926-
MaxVal = MaxVal.zext(CI->getBitWidth());
5927-
if (MaxVal.eq(CI->getValue()))
5928-
break; // Recognized
5929-
}
5930-
return nullptr;
5931-
59325909
case ICmpInst::ICMP_ULT:
59335910
// Recognize pattern:
59345911
// mulval = mul(zext A, zext B)
@@ -5998,13 +5975,11 @@ static Instruction *processUMulZExtIdiom(ICmpInst &I, Value *MulVal,
59985975
Inverse = true;
59995976
break;
60005977
case ICmpInst::ICMP_UGT:
6001-
case ICmpInst::ICMP_UGE:
60025978
if (I.getOperand(0) == MulVal)
60035979
break;
60045980
Inverse = true;
60055981
break;
60065982
case ICmpInst::ICMP_ULT:
6007-
case ICmpInst::ICMP_ULE:
60085983
if (I.getOperand(1) == MulVal)
60095984
break;
60105985
Inverse = true;

0 commit comments

Comments
 (0)