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

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 8 04:17:09 PDT 2025


================
@@ -3210,6 +3213,56 @@ static SDValue performTruncateCombine(SDNode *N,
   return truncateVectorWithNARROW(OutVT, In, DL, DAG);
 }
 
+static SDValue performVSelectCombine(SDNode *N,
+                                     TargetLowering::DAGCombinerInfo &DCI) {
+  // In the tablegen.td, vselect A B C -> bitselect B C A
+
+  // SCENARIO 1
+  // vselect Y, <0>, X
----------------
lukel97 wrote:

We need to be careful here because selects block poison in either operands, so if remove the select then we need to freeze the arguments

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


More information about the llvm-commits mailing list