]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Remove @ of vec_duplicate pattern
authorJuzhe-Zhong <juzhe.zhong@rivai.ai>
Fri, 22 Sep 2023 08:28:46 +0000 (16:28 +0800)
committerLehua Ding <lehua.ding@rivai.ai>
Fri, 22 Sep 2023 08:32:36 +0000 (16:32 +0800)
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.

gcc/config/riscv/riscv-v.cc
gcc/config/riscv/vector.md

index a3672bad5212b235e32758291ba94aa06b53077d..4d0e1d8d1a90be9b47cb4e6d6c95038c05e56060 100644 (file)
@@ -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);
 }
index 73f90dea36b2b7330d38e019f4db67f8cbd4373c..d5300a339464ed023b3a1aa3335507574e3070cb 100644 (file)
 ;; 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")))]