[llvm] [GISel][CombinerHelper] Combine and(trunc(x), trunc(y)) -> trunc(and(x, y)) (PR #89023)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 17 06:24:34 PDT 2024


================
@@ -963,6 +963,9 @@ class CombinerHelper {
 
   // Simplify (cmp cc0 x, y) (&& or ||) (cmp cc1 x, y) -> cmp cc2 x, y.
   bool tryFoldLogicOfFCmps(GLogicalBinOp *Logic, BuildFnTy &MatchInfo);
+
+  // Simplify (trunc v1) && (trunc v2) -> trunc (v1 && v2)
----------------
jayfoad wrote:

`&&` seems wrong here?
```suggestion
  // Simplify (trunc v1) & (trunc v2) -> trunc (v1 & v2)
```

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


More information about the llvm-commits mailing list