summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-07-10 16:07:35 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-07-10 16:07:35 +0000
commitc5f92bd67beabfc2c8d20af9a799a8c9c8f7ed95 (patch)
tree41cddfc863815e553dfedf3c22bd89362cd5b2de /llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
parentbf223dff7ef076733c9b28c992028ee2dc8c9114 (diff)
downloadbcm5719-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/InstCombineCompares.cpp')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 4c818193ced..3a4283ae540 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -3316,7 +3316,8 @@ foldShiftIntoShiftInAnotherHandOfAndInICmp(ICmpInst &I, const SimplifyQuery SQ,
// 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. The shift is the same that was for X.
Value *T0 = XShiftOpcode == Instruction::BinaryOps::LShr
OpenPOWER on IntegriCloud