[llvm] [RISCV][ISel] Remove redundant vmerge for the vwadd. (PR #78403)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 17 17:54:03 PST 2024


================
@@ -13457,6 +13457,55 @@ combineBinOp_VLToVWBinOp_VL(SDNode *N, TargetLowering::DAGCombinerInfo &DCI) {
   return InputRootReplacement;
 }
 
+// (vwadd y, (select cond, x, 0)) -> select cond (vwadd y, x), y
+static SDValue combineVWADDSelect(SDNode *N, SelectionDAG &DAG) {
+  unsigned Opc = N->getOpcode();
+  assert(Opc == RISCVISD::VWADD_VL || Opc == RISCVISD::VWADD_W_VL ||
----------------
sun-jacobi wrote:

The check in `performVWADD_VLCombine` is for  `RISCVISD::VWADD_W_VL` and `RISCVISD::VWADDU_W_VL`. 
We need to first do `combineBinOp_VLToVWBinOp_VL` on those.

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


More information about the llvm-commits mailing list