[V4] RISC-V: Enable basic RVV auto-vectorization support.

Message ID 20230505140643.1322399-1-juzhe.zhong@rivai.ai
State Accepted
Headers
Series [V4] RISC-V: Enable basic RVV auto-vectorization support. |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

juzhe.zhong@rivai.ai May 5, 2023, 2:06 p.m. UTC
  From: Juzhe-Zhong <juzhe.zhong@rivai.ai>

This patch is depending on https://patchwork.sourceware.org/project/gcc/patch/20230504054544.203366-1-juzhe.zhong@rivai.ai/
Fix codes according to comments of Kito.

gcc/ChangeLog:

        * config/riscv/riscv.cc (riscv_get_arg_info): Move RVV type argument handling outside.

---
 gcc/config/riscv/riscv.cc | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/gcc/config/riscv/riscv.cc b/gcc/config/riscv/riscv.cc
index 1a35e02796d..8d3cd4261d2 100644
--- a/gcc/config/riscv/riscv.cc
+++ b/gcc/config/riscv/riscv.cc
@@ -3791,16 +3791,16 @@  riscv_get_arg_info (struct riscv_arg_info *info, const CUMULATIVE_ARGS *cum,
   info->gpr_offset = cum->num_gprs;
   info->fpr_offset = cum->num_fprs;
 
+  /* TODO: Currently, it will produce ICE for --param
+     riscv-autovec-preference=fixed-vlmax. So, we just return NULL_RTX here
+     let GCC genearte loads/stores. Ideally, GCC should either report
+     Warning message to tell user do not use RVV vector type in function
+     arg, or GCC just support function arg calling convention for RVV
+     directly.  */
+  if (riscv_v_ext_mode_p (mode))
+    return NULL_RTX;
   if (named)
     {
-      /* TODO: Currently, it will produce ICE for --param
-	 riscv-autovec-preference=fixed-vlmax. So, we just return NULL_RTX here
-	 let GCC genearte loads/stores. Ideally, GCC should either report
-	 Warning message to tell user do not use RVV vector type in function
-	 arg, or GCC just support function arg calling convention for RVV
-	 directly.  */
-      if (riscv_v_ext_mode_p (mode))
-	return NULL_RTX;
       riscv_aggregate_field fields[2];
       unsigned fregno = fpr_base + info->fpr_offset;
       unsigned gregno = gpr_base + info->gpr_offset;