From: Juzhe-Zhong Date: Fri, 22 Sep 2023 08:28:46 +0000 (+0800) Subject: RISC-V: Remove @ of vec_duplicate pattern X-Git-Tag: basepoints/gcc-15~5917 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6eb55cab2956d130d2e18c895e4f67fc9381199e;p=thirdparty%2Fgcc.git 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): Remove @. (vec_duplicate): Ditto. --- diff --git a/gcc/config/riscv/riscv-v.cc b/gcc/config/riscv/riscv-v.cc index a3672bad5212..4d0e1d8d1a90 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 73f90dea36b2..d5300a339464 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" +(define_insn_and_split "vec_duplicate" [(set (match_operand:V_VLS 0 "register_operand") (vec_duplicate:V_VLS (match_operand: 1 "direct_broadcast_operand")))]