public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Remove @ of vec_duplicate pattern
@ 2023-09-26 15:12 Jeff Law
  0 siblings, 0 replies; only message in thread
From: Jeff Law @ 2023-09-26 15:12 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:12c676cd9341793dae13138f57b324cadf28897f

commit 12c676cd9341793dae13138f57b324cadf28897f
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Fri Sep 22 16:28:46 2023 +0800

    RISC-V: Remove @ of vec_duplicate pattern
    
    It's obvious the @ of vec_duplicate pattern is duplicate.
    
    Regression passed.
    
    Committed.
    gcc/ChangeLog:
    
            * config/riscv/riscv-v.cc (gen_const_vector_dup): Use global expand function.
            * config/riscv/vector.md (@vec_duplicate<mode>): Remove @.
            (vec_duplicate<mode>): Ditto.
    
    (cherry picked from commit 6eb55cab2956d130d2e18c895e4f67fc9381199e)

Diff:
---
 gcc/config/riscv/riscv-v.cc | 4 +---
 gcc/config/riscv/vector.md  | 2 +-
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc
index a3672bad521..4d0e1d8d1a9 100644
--- a/gcc/config/riscv/riscv-v.cc
+++ b/gcc/config/riscv/riscv-v.cc
@@ -696,9 +696,7 @@ gen_const_vector_dup (machine_mode mode, poly_int64 val)
     {
       /* When VAL is const_poly_int value, we need to explicitly broadcast
 	 it into a vector using RVV broadcast instruction.  */
-      rtx dup = gen_reg_rtx (mode);
-      emit_insn (gen_vec_duplicate (mode, dup, c));
-      return dup;
+      return expand_vector_broadcast (mode, c);
     }
    return gen_const_vec_duplicate (mode, c);
 }
diff --git a/gcc/config/riscv/vector.md b/gcc/config/riscv/vector.md
index 73f90dea36b..d5300a33946 100644
--- a/gcc/config/riscv/vector.md
+++ b/gcc/config/riscv/vector.md
@@ -1371,7 +1371,7 @@
 ;; This pattern only handles duplicates of non-constant inputs.
 ;; Constant vectors go through the movm pattern instead.
 ;; So "direct_broadcast_operand" can only be mem or reg, no CONSTANT.
-(define_insn_and_split "@vec_duplicate<mode>"
+(define_insn_and_split "vec_duplicate<mode>"
   [(set (match_operand:V_VLS 0 "register_operand")
         (vec_duplicate:V_VLS
           (match_operand:<VEL> 1 "direct_broadcast_operand")))]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-26 15:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-26 15:12 [gcc(refs/vendors/riscv/heads/gcc-13-with-riscv-opts)] RISC-V: Remove @ of vec_duplicate pattern Jeff Law

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).