[llvm] [VPlan] Split simplifyRecipes into simplifyRecipes and combineRecipes (PR #221924)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 02:12:03 PDT 2026


================
@@ -1327,54 +1403,87 @@ static VPValue *simplifyRecipe(VPlan &Plan, VPSingleDefRecipe *Def) {
   bool CanCreateNewRecipe =
       !isa<VPInstruction>(Def) || !Def->getUnderlyingValue();
 
-  VPValue *A, *Z;
+  VPValue *A, *X, *Y, *Z;
 
-  // A bitcast to the same type is a no-op.
-  if (match(Def, m_BitCast(m_VPValue(A))) &&
-      Def->getScalarType() == A->getScalarType())
-    return A;
+  // x && (y && x) -> x && y
+  if (CanCreateNewRecipe &&
----------------
lukel97 wrote:

This was missing a `CanCreateNewRecipe` check previously, so I've added it whilst we're here.

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


More information about the llvm-commits mailing list