You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: llvm/test/CodeGen/RISCV/rvv/calling-conv-fastcc.ll
+116Lines changed: 116 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -633,3 +633,119 @@ define fastcc <vscale x 32 x i32> @pass_vector_arg_indirect_stack(<vscale x 32 x
633
633
%s = callfastcc <vscale x 32 x i32> @vector_arg_indirect_stack(i320, i321, i322, i323, i324, i325, i326, i327, <vscale x 32 x i32> zeroinitializer, <vscale x 32 x i32> zeroinitializer, <vscale x 32 x i32> zeroinitializer, i328)
634
634
ret <vscale x 32 x i32> %s
635
635
}
636
+
637
+
; Test case where we are out of registers for the vector and all GPRs are used.
638
+
definefastcc <vscale x 16 x i32> @vector_arg_indirect_stack_no_gpr(i32%0, i32%1, i32%2, i32%3, i32%4, i32%5, i32%6, i32%7, i32%8, i32%9, i32%10, i32%11, <vscale x 16 x i32> %x, <vscale x 16 x i32> %y, <vscale x 16 x i32> %z) {
639
+
; RV32-LABEL: vector_arg_indirect_stack_no_gpr:
640
+
; RV32: # %bb.0:
641
+
; RV32-NEXT: lw a0, 0(sp)
642
+
; RV32-NEXT: vl8re32.v v16, (a0)
643
+
; RV32-NEXT: vsetvli a0, zero, e32, m8, ta, ma
644
+
; RV32-NEXT: vadd.vv v8, v8, v16
645
+
; RV32-NEXT: ret
646
+
;
647
+
; RV64-LABEL: vector_arg_indirect_stack_no_gpr:
648
+
; RV64: # %bb.0:
649
+
; RV64-NEXT: ld a0, 0(sp)
650
+
; RV64-NEXT: vl8re32.v v16, (a0)
651
+
; RV64-NEXT: vsetvli a0, zero, e32, m8, ta, ma
652
+
; RV64-NEXT: vadd.vv v8, v8, v16
653
+
; RV64-NEXT: ret
654
+
%s = add <vscale x 16 x i32> %x, %z
655
+
ret <vscale x 16 x i32> %s
656
+
}
657
+
658
+
; Calling the function above. Ensure we pass the arguments correctly.
659
+
definefastcc <vscale x 16 x i32> @pass_vector_arg_indirect_stack_no_gpr(<vscale x 16 x i32> %x, <vscale x 16 x i32> %y, <vscale x 16 x i32> %z) {
%s = callfastcc <vscale x 16 x i32> @vector_arg_indirect_stack_no_gpr(i320, i321, i322, i323, i324, i325, i326, i327, i328, i329, i3210, i3211, <vscale x 16 x i32> zeroinitializer, <vscale x 16 x i32> zeroinitializer, <vscale x 16 x i32> zeroinitializer)
0 commit comments