[llvm] [WASM] Fold bitselect with splat zero (PR #147305)

Ricardo Jesus via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 9 00:55:26 PDT 2025


================
@@ -13158,6 +13158,14 @@ static SDValue combineVSelectWithAllOnesOrZeros(SDValue Cond, SDValue TVal,
     return DAG.getBitcast(VT, Or);
   }
 
+  // select Cond, 0, x → and (Cond, !x)
----------------
rj-jesus wrote:

> select Cond, 0, x → and (Cond, !x)

Are you sure about this? Shouldn't it be `and (~Cond, x)`?

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


More information about the llvm-commits mailing list