[llvm] [InstCombine] Resolve FIXME: Use commutative matchers (PR #81060)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 16:53:15 PST 2024


================
@@ -2542,8 +2539,8 @@ Instruction *InstCombinerImpl::visitAnd(BinaryOperator &I) {
     }
   }
 
-  if (match(&I, m_And(m_OneUse(m_Shl(m_ZExt(m_Value(X)), m_Value(Y))),
-                      m_SignMask())) &&
+  if (match(&I, m_c_And(m_OneUse(m_Shl(m_ZExt(m_Value(X)), m_Value(Y))),
+                        m_SignMask())) &&
----------------
topperc wrote:

m_SignMask is a constant so it should be canonicalized to the right hand side

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


More information about the llvm-commits mailing list