[llvm] [RISCV] Use vwadd.vx for splat vector with extension (PR #87249)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 8 00:33:45 PDT 2024


================
@@ -13598,14 +13598,26 @@ struct NodeExtensionHelper {
     case RISCVISD::VZEXT_VL:
     case RISCVISD::FP_EXTEND_VL:
       return OrigOperand.getOperand(0);
+    case ISD::SPLAT_VECTOR: {
+      SDValue Op = OrigOperand.getOperand(0);
+      unsigned Opc = Op.getOpcode();
+      if (SupportsSExt && Opc == ISD::SIGN_EXTEND_INREG)
+        return Op.getOperand(0);
+
+      if (SupportsZExt && Opc == ISD::AND)
+        return Op.getOperand(0);
----------------
sun-jacobi wrote:

These 2 patterns correspond to the case (splat_vector (sext op)). But we may also need to consider a constant splat like (splat_vector -1).

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


More information about the llvm-commits mailing list