[PATCH] D109155: [InstCombine] Fold BW/2+1 tops bits are same pattern
Dave Green via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 2 12:10:29 PDT 2021
dmgreen added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp:4510
+ if (match(&I,
+ m_c_ICmp(
+ TPred, m_Trunc(m_LShr(m_Value(A), m_SpecificInt(BitWidth))),
----------------
spatel wrote:
> We don't need the commutative matcher (and the regression test shows this). That's because we always canonicalize the 'ashr' as op0 and 'trunc' as op1 based on `getComplexity`.
>
> Actually, we don't need to rematch the icmp at all if we handle both predicates - see next comment.
Oh that's good to hear. Yeah the only reason for starting the match at the ICmp was to get commutativity through the m_c_ICmp.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D109155/new/
https://reviews.llvm.org/D109155
More information about the llvm-commits
mailing list