[PATCH] D17184: [LVI] Extend select handling to catch min/max/clamp idioms
Sanjoy Das via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 26 14:41:28 PST 2016
sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.
lgtm
================
Comment at: lib/Analysis/LazyValueInfo.cpp:922
@@ +921,3 @@
+ if (SelectPatternResult::isMinOrMax(SPR.Flavor) &&
+ LHS == SI->getTrueValue() && RHS == SI->getFalseValue()) {
+ switch (SPR.Flavor) {
----------------
Is it possible for `LHS` to be the false value and `RHS` to be the true value?
================
Comment at: lib/Analysis/LazyValueInfo.cpp:981
@@ +980,3 @@
+ case ICmpInst::ICMP_EQ:
+ if (match(SI->getFalseValue(), m_Add(m_Specific(A),
+ m_ConstantInt(CIAdded)))) {
----------------
Makes sense.
http://reviews.llvm.org/D17184
More information about the llvm-commits
mailing list