[llvm] [DAG] combineVSelectWithAllOnesOrZeros - fold select Cond, 0, x -> and not(Cond), x (PR #147472)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 03:27:02 PDT 2025


================
@@ -9902,11 +9902,14 @@ SDValue DAGCombiner::visitXOR(SDNode *N) {
     if (SDValue Combined = visitADDLike(N))
       return Combined;
 
-  // fold !(x cc y) -> (x !cc y)
+  // fold xor (setcc x y cc) -1 -> setcc x y !cc
+  // Avoid breaking: and (xor (setcc x y cc) -1) z -> andn for vec
----------------
woruyu wrote:

Done!

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


More information about the llvm-commits mailing list