[PATCH] D27531: [InstCombine] add folds for icmp (smin X, Y), X
David Majnemer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 7 13:32:39 PST 2016
majnemer added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombineCompares.cpp:3040-3041
+ // Canonicalize minimum operand to LHS of the icmp.
+ if (match(X, m_SMin(m_Specific(Op0), m_Value())) ||
+ match(X, m_SMin(m_Value(), m_Specific(Op0)))) {
+ std::swap(Op0, X);
----------------
Might be nice to have a `m_c_SMin` or something, would simplify this expression and the one bellow.
https://reviews.llvm.org/D27531
More information about the llvm-commits
mailing list