[PATCH] D124710: [InstCombine] Fold ((A&B)^C)|B
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 3 02:36:56 PDT 2022
nikic added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:2692
+ // ((A & B) ^ C) | B -> C | B
+ if (match(Op1, m_Value(B)))
+ if (match(Op0, m_c_Xor(m_c_And(m_Value(A), m_Specific(B)), m_Value(C))))
----------------
Doing a match directly on m_Value doesn't make a lot of sense -- what you're doing here is essentially just `B = Op1`. Instead, you should directly use `m_Specific(Op1)` in the other match.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124710/new/
https://reviews.llvm.org/D124710
More information about the llvm-commits
mailing list