From c5f92bd67beabfc2c8d20af9a799a8c9c8f7ed95 Mon Sep 17 00:00:00 2001 From: Roman Lebedev Date: Wed, 10 Jul 2019 16:07:35 +0000 Subject: [PatternMatch] Generalize m_SpecificInt_ULT() to take ICmpInst::Predicate As discussed in the original review, this may be useful, so let's just do it. llvm-svn: 365652 --- llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp index 0bbecde2184..c821292400c 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp @@ -48,7 +48,8 @@ reassociateShiftAmtsOfTwoSameDirectionShifts(BinaryOperator *Sh0, // Is the new shift amount smaller than the bit width? // FIXME: could also rely on ConstantRange. unsigned BitWidth = X->getType()->getScalarSizeInBits(); - if (!match(NewShAmt, m_SpecificInt_ULT(APInt(BitWidth, BitWidth)))) + if (!match(NewShAmt, m_SpecificInt_ICMP(ICmpInst::Predicate::ICMP_ULT, + APInt(BitWidth, BitWidth)))) return nullptr; // All good, we can do this fold. BinaryOperator *NewShift = BinaryOperator::Create(ShiftOpcode, X, NewShAmt); -- cgit v1.2.3