[llvm] fold select_cc seteq (and x, 1) 0, 0, -1 -> neg(and(x, 1)) (PR #152062)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 4 17:59:32 PDT 2025


================
@@ -28963,6 +28963,17 @@ SDValue DAGCombiner::SimplifySelectCC(const SDLoc &DL, SDValue N0, SDValue N1,
   if (SDValue V = foldSelectCCToShiftAnd(DL, N0, N1, N2, N3, CC))
     return V;
 
+  // fold select_cc seteq (and x, 1) 0, 0, -1 -> neg(and(x, 1))
----------------
topperc wrote:

```suggestion
  // fold select_cc seteq (and x, 1), 0, 0, -1 -> neg(and(x, 1))
```

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


More information about the llvm-commits mailing list