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

via llvm-commits llvm-commits at lists.llvm.org
Sun May 19 02:57:06 PDT 2024


================
@@ -935,6 +935,22 @@ static void simplifyRecipe(VPRecipeBase &R, VPTypeAnalysis &TypeInfo) {
 #endif
   }
 
+  VPValue *X;
+  VPValue *Y;
+  VPValue *X1;
+  VPValue *Y1;
+  // Simplify (X && Y) || (X && !Y) -> X.
+  // TODO: Split up into simpler, modular combines: (X && Y) || (X && Z) into X
+  // && (Y || Z) and (X || !X) into true. This requires queuing newly created
+  // recipes to be visited during simplification.
----------------
ayalz wrote:

```suggestion
  // Simplify (X && Y) || (X && !Y) -> X.
  // TODO: Split up into simpler, modular combines: (X && Y) || (X && Z) into X
  // && (Y || Z) and (X || !X) into true. This requires queuing newly created
  // recipes to be visited during simplification.
  VPValue *X, Y, X1, Y1;
```
nit: better place definitions together, and closer to their use.

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


More information about the llvm-commits mailing list