[llvm] [RISCV] Select add(vec, splat(scalar)) to PADD_*S for P extension (PR #190303)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 22:32:19 PDT 2026


================
@@ -1796,10 +1796,26 @@ let Predicates = [HasStdExtP] in {
   // Basic 8-bit arithmetic patterns
   def : PatGprGpr<add, PADD_B, XLenVecI8VT>;
   def : PatGprGpr<sub, PSUB_B, XLenVecI8VT>;
+  def : Pat<(XLenVecI8VT
+              (add (XLenVecI8VT GPR:$rs1),
----------------
sihuan wrote:

Thanks for pointing this out, I’ve removed the redundant casts.

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


More information about the llvm-commits mailing list