[llvm] [VPlan] Remove redundant x && (y && x) -> x && y combine (PR #213219)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 01:54:43 PDT 2026


================
@@ -1188,19 +1192,12 @@ static bool simplifyLogicalRecipe(VPSingleDefRecipe *Def, VPBuilder &Builder,
   }
 
   // x && (x && y) -> x && y
-  if (match(Def, m_LogicalAnd(m_VPValue(X),
-                              m_LogicalAnd(m_Deferred(X), m_VPValue())))) {
+  if (match(Def, m_c_LogicalAnd(m_VPValue(X),
+                                m_c_LogicalAnd(m_Deferred(X), m_VPValue())))) {
     Def->replaceAllUsesWith(Def->getOperand(1));
----------------
lukel97 wrote:

Yup, the first m_c_LogicalAnd shouldn't be there.

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


More information about the llvm-commits mailing list