diff options
author | Roman Lebedev <lebedev.ri@gmail.com> | 2019-07-10 16:07:35 +0000 |
---|---|---|
committer | Roman Lebedev <lebedev.ri@gmail.com> | 2019-07-10 16:07:35 +0000 |
commit | c5f92bd67beabfc2c8d20af9a799a8c9c8f7ed95 (patch) | |
tree | 41cddfc863815e553dfedf3c22bd89362cd5b2de /llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp | |
parent | bf223dff7ef076733c9b28c992028ee2dc8c9114 (diff) | |
download | bcm5719-llvm-c5f92bd67beabfc2c8d20af9a799a8c9c8f7ed95.tar.gz bcm5719-llvm-c5f92bd67beabfc2c8d20af9a799a8c9c8f7ed95.zip |
[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
Diffstat (limited to 'llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
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); |