20 changes: 20 additions & 0 deletions llvm/test/CodeGen/X86/GlobalISel/irtranslator-callingconv.ll
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ define i8 @test_i8_args_8(i8 %arg1, i8 %arg2, i8 %arg3, i8 %arg4, i8 %arg5, i8 %
; X86-NEXT: G_STORE [[TRUNC7]](s8), [[GV2]](p0) :: (store (s8) into @a8_8bit)
; X86-NEXT: $al = COPY [[TRUNC]](s8)
; X86-NEXT: RET 0, implicit $al
;
; X64-LABEL: name: test_i8_args_8
; X64: bb.1.entry:
; X64-NEXT: liveins: $ecx, $edi, $edx, $esi, $r8d, $r9d
Expand Down Expand Up @@ -109,6 +110,7 @@ define i32 @test_i32_args_8(i32 %arg1, i32 %arg2, i32 %arg3, i32 %arg4, i32 %arg
; X86-NEXT: G_STORE [[LOAD7]](s32), [[GV2]](p0) :: (store (s32) into @a8_32bit)
; X86-NEXT: $eax = COPY [[LOAD]](s32)
; X86-NEXT: RET 0, implicit $eax
;
; X64-LABEL: name: test_i32_args_8
; X64: bb.1.entry:
; X64-NEXT: liveins: $ecx, $edi, $edx, $esi, $r8d, $r9d
Expand Down Expand Up @@ -196,6 +198,7 @@ define i64 @test_i64_args_8(i64 %arg1, i64 %arg2, i64 %arg3, i64 %arg4, i64 %arg
; X86-NEXT: $eax = COPY [[UV]](s32)
; X86-NEXT: $edx = COPY [[UV1]](s32)
; X86-NEXT: RET 0, implicit $eax, implicit $edx
;
; X64-LABEL: name: test_i64_args_8
; X64: bb.1.entry:
; X64-NEXT: liveins: $rcx, $rdi, $rdx, $rsi, $r8, $r9
Expand Down Expand Up @@ -234,6 +237,7 @@ define float @test_float_args(float %arg1, float %arg2) {
; X86-NEXT: [[LOAD1:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX1]](p0) :: (invariant load (s32) from %fixed-stack.0)
; X86-NEXT: $fp0 = COPY [[LOAD1]](s32)
; X86-NEXT: RET 0, implicit $fp0
;
; X64-LABEL: name: test_float_args
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $xmm0, $xmm1
Expand All @@ -254,6 +258,7 @@ define double @test_double_args(double %arg1, double %arg2) {
; X86-NEXT: [[LOAD1:%[0-9]+]]:_(s64) = G_LOAD [[FRAME_INDEX1]](p0) :: (invariant load (s64) from %fixed-stack.0)
; X86-NEXT: $fp0 = COPY [[LOAD1]](s64)
; X86-NEXT: RET 0, implicit $fp0
;
; X64-LABEL: name: test_double_args
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $xmm0, $xmm1
Expand All @@ -274,6 +279,7 @@ define <4 x i32> @test_v4i32_args(<4 x i32> %arg1, <4 x i32> %arg2) {
; X86-NEXT: [[COPY1:%[0-9]+]]:_(<4 x s32>) = COPY $xmm1
; X86-NEXT: $xmm0 = COPY [[COPY1]](<4 x s32>)
; X86-NEXT: RET 0, implicit $xmm0
;
; X64-LABEL: name: test_v4i32_args
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $xmm0, $xmm1
Expand All @@ -297,6 +303,7 @@ define <8 x i32> @test_v8i32_args(<8 x i32> %arg1) {
; X86-NEXT: $xmm0 = COPY [[UV]](<4 x s32>)
; X86-NEXT: $xmm1 = COPY [[UV1]](<4 x s32>)
; X86-NEXT: RET 0, implicit $xmm0, implicit $xmm1
;
; X64-LABEL: name: test_v8i32_args
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $xmm0, $xmm1
Expand All @@ -315,6 +322,7 @@ define void @test_void_return() {
; X86-LABEL: name: test_void_return
; X86: bb.1.entry:
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_void_return
; X64: bb.1.entry:
; X64-NEXT: RET 0
Expand All @@ -329,6 +337,7 @@ define ptr @test_memop_i32(ptr %p1) {
; X86-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (invariant load (p0) from %fixed-stack.0, align 16)
; X86-NEXT: $eax = COPY [[LOAD]](p0)
; X86-NEXT: RET 0, implicit $eax
;
; X64-LABEL: name: test_memop_i32
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $rdi
Expand All @@ -347,6 +356,7 @@ define void @test_trivial_call() {
; X86-NEXT: CALLpcrel32 @trivial_callee, csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 0, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_trivial_call
; X64: bb.1 (%ir-block.0):
; X64-NEXT: ADJCALLSTACKDOWN64 0, 0, 0, implicit-def $rsp, implicit-def $eflags, implicit-def $ssp, implicit $rsp, implicit $ssp
Expand Down Expand Up @@ -377,6 +387,7 @@ define void @test_simple_arg(i32 %in0, i32 %in1) {
; X86-NEXT: CALLpcrel32 @simple_arg_callee, csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 8, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_simple_arg
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $edi, $esi
Expand Down Expand Up @@ -435,6 +446,7 @@ define void @test_simple_arg8_call(i32 %in0) {
; X86-NEXT: CALLpcrel32 @simple_arg8_callee, csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 32, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_simple_arg8_call
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $edi
Expand Down Expand Up @@ -478,6 +490,7 @@ define i32 @test_simple_return_callee() {
; X86-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY1]]
; X86-NEXT: $eax = COPY [[ADD]](s32)
; X86-NEXT: RET 0, implicit $eax
;
; X64-LABEL: name: test_simple_return_callee
; X64: bb.1 (%ir-block.0):
; X64-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
Expand Down Expand Up @@ -521,6 +534,7 @@ define <8 x i32> @test_split_return_callee(<8 x i32> %arg1, <8 x i32> %arg2) {
; X86-NEXT: $xmm0 = COPY [[UV2]](<4 x s32>)
; X86-NEXT: $xmm1 = COPY [[UV3]](<4 x s32>)
; X86-NEXT: RET 0, implicit $xmm0, implicit $xmm1
;
; X64-LABEL: name: test_split_return_callee
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $xmm0, $xmm1, $xmm2, $xmm3
Expand Down Expand Up @@ -559,6 +573,7 @@ define void @test_indirect_call(ptr %func) {
; X86-NEXT: CALL32r [[LOAD]](p0), csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 0, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_indirect_call
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $rdi
Expand Down Expand Up @@ -603,6 +618,7 @@ define void @test_abi_exts_call(ptr %addr) {
; X86-NEXT: CALLpcrel32 @take_char, csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 4, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_abi_exts_call
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $rdi
Expand Down Expand Up @@ -654,6 +670,7 @@ define void @test_variadic_call_1(ptr %addr_ptr, ptr %val_ptr) {
; X86-NEXT: CALLpcrel32 @variadic_callee, csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 8, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_variadic_call_1
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $rdi, $rsi
Expand Down Expand Up @@ -696,6 +713,7 @@ define void @test_variadic_call_2(ptr %addr_ptr, ptr %val_ptr) {
; X86-NEXT: CALLpcrel32 @variadic_callee, csr_32, implicit $esp, implicit $ssp
; X86-NEXT: ADJCALLSTACKUP32 12, 0, implicit-def $esp, implicit-def $eflags, implicit-def $ssp, implicit $esp, implicit $ssp
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_variadic_call_2
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $rdi, $rsi
Expand Down Expand Up @@ -728,6 +746,7 @@ define <32 x float> @test_return_v32f32() {
; X86-NEXT: G_STORE [[BUILD_VECTOR]](<32 x s32>), [[LOAD]](p0) :: (store (<32 x s32>))
; X86-NEXT: $eax = COPY [[LOAD]](p0)
; X86-NEXT: RET 0
;
; X64-LABEL: name: test_return_v32f32
; X64: bb.1 (%ir-block.0):
; X64-NEXT: liveins: $rdi
Expand Down Expand Up @@ -757,6 +776,7 @@ define float @test_call_v32f32() {
; X86-NEXT: [[EVEC:%[0-9]+]]:_(s32) = G_EXTRACT_VECTOR_ELT [[LOAD]](<32 x s32>), [[C]](s32)
; X86-NEXT: $fp0 = COPY [[EVEC]](s32)
; X86-NEXT: RET 0, implicit $fp0
;
; X64-LABEL: name: test_call_v32f32
; X64: bb.1 (%ir-block.0):
; X64-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
Expand Down