[llvm] [VPlan] Simplify (X && Y) || (X && !Y) -> X. (PR #89386)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 05:50:09 PDT 2024


================
@@ -270,9 +270,15 @@ m_Mul(const Op0_t &Op0, const Op1_t &Op1) {
 
 template <typename Op0_t, typename Op1_t>
 inline AllBinaryRecipe_match<Op0_t, Op1_t, Instruction::Or>
-m_Or(const Op0_t &Op0, const Op1_t &Op1) {
+m_BinaryOr(const Op0_t &Op0, const Op1_t &Op1) {
----------------
fhahn wrote:

This is to clarify the matcher now that we have separate ones for logical AND and in line with naming of the IR pattern matcher.

For printing, we rely on Instruction::getName to print Instruction opcodes, so I think it would probably be good to keep printing as regular `or` to stay consistent with the original/underlying IR

https://github.com/llvm/llvm-project/pull/89386


More information about the llvm-commits mailing list