@@ -3005,7 +3005,7 @@ static Value *simplifyICmpWithZero(CmpInst::Predicate Pred, Value *LHS,
3005
3005
}
3006
3006
3007
3007
static Value *simplifyICmpWithConstant (CmpInst::Predicate Pred, Value *LHS,
3008
- Value *RHS, const InstrInfoQuery &IIQ ) {
3008
+ Value *RHS, const SimplifyQuery &SQ ) {
3009
3009
Type *ITy = getCompareTy (RHS); // The return type.
3010
3010
3011
3011
Value *X;
@@ -3031,8 +3031,8 @@ static Value *simplifyICmpWithConstant(CmpInst::Predicate Pred, Value *LHS,
3031
3031
if (RHS_CR.isFullSet ())
3032
3032
return ConstantInt::getTrue (ITy);
3033
3033
3034
- ConstantRange LHS_CR =
3035
- computeConstantRange ( LHS, CmpInst::isSigned (Pred), IIQ. UseInstrInfo );
3034
+ ConstantRange LHS_CR = llvm::computeConstantRangeIncludingKnownBits (
3035
+ LHS, CmpInst::isSigned (Pred), SQ );
3036
3036
if (!LHS_CR.isFullSet ()) {
3037
3037
if (RHS_CR.contains (LHS_CR))
3038
3038
return ConstantInt::getTrue (ITy);
@@ -3043,7 +3043,7 @@ static Value *simplifyICmpWithConstant(CmpInst::Predicate Pred, Value *LHS,
3043
3043
// (mul nuw/nsw X, MulC) != C --> true (if C is not a multiple of MulC)
3044
3044
// (mul nuw/nsw X, MulC) == C --> false (if C is not a multiple of MulC)
3045
3045
const APInt *MulC;
3046
- if (IIQ.UseInstrInfo && ICmpInst::isEquality (Pred) &&
3046
+ if (SQ. IIQ .UseInstrInfo && ICmpInst::isEquality (Pred) &&
3047
3047
((match (LHS, m_NUWMul (m_Value (), m_APIntAllowUndef (MulC))) &&
3048
3048
*MulC != 0 && C->urem (*MulC) != 0 ) ||
3049
3049
(match (LHS, m_NSWMul (m_Value (), m_APIntAllowUndef (MulC))) &&
@@ -3749,7 +3749,7 @@ static Value *simplifyICmpInst(unsigned Predicate, Value *LHS, Value *RHS,
3749
3749
if (Value *V = simplifyICmpWithZero (Pred, LHS, RHS, Q))
3750
3750
return V;
3751
3751
3752
- if (Value *V = simplifyICmpWithConstant (Pred, LHS, RHS, Q. IIQ ))
3752
+ if (Value *V = simplifyICmpWithConstant (Pred, LHS, RHS, Q))
3753
3753
return V;
3754
3754
3755
3755
// If both operands have range metadata, use the metadata
0 commit comments