[PATCH] D101210: [InstCombine] ctpop(X) + ctpop(Y) => ctpop(X | Y) if X and Y have no common bits (PR48999)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Apr 24 07:53:00 PDT 2021
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp:1453
+ if (match(&I,
+ m_c_BinOp(m_OneUse(m_Intrinsic<Intrinsic::ctpop>(m_Value(A))),
+ m_OneUse(m_Intrinsic<Intrinsic::ctpop>(m_Value(B))))) &&
----------------
As the pattern on both sides is the same, you don't need to use m_c_BinOp, you can just directly match LHS and RHS against ctpop.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D101210/new/
https://reviews.llvm.org/D101210
More information about the llvm-commits
mailing list