1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=nvptx-unknown-unknown | FileCheck %s
4 %struct.St8x4 = type { [4 x i64] }
6 define dso_local void @caller_St8x4(ptr nocapture noundef readonly byval(%struct.St8x4) align 8 %in, ptr nocapture noundef writeonly %ret) {
7 ; CHECK-LABEL: caller_St8x4(
9 ; CHECK-NEXT: .local .align 8 .b8 __local_depot0[32];
10 ; CHECK-NEXT: .reg .b32 %SP;
11 ; CHECK-NEXT: .reg .b32 %SPL;
12 ; CHECK-NEXT: .reg .b32 %r<2>;
13 ; CHECK-NEXT: .reg .b64 %rd<13>;
15 ; CHECK-NEXT: // %bb.0:
16 ; CHECK-NEXT: mov.u32 %SPL, __local_depot0;
17 ; CHECK-NEXT: cvta.local.u32 %SP, %SPL;
18 ; CHECK-NEXT: ld.param.u32 %r1, [caller_St8x4_param_1];
19 ; CHECK-NEXT: ld.param.u64 %rd1, [caller_St8x4_param_0+24];
20 ; CHECK-NEXT: st.u64 [%SP+24], %rd1;
21 ; CHECK-NEXT: ld.param.u64 %rd2, [caller_St8x4_param_0+16];
22 ; CHECK-NEXT: st.u64 [%SP+16], %rd2;
23 ; CHECK-NEXT: ld.param.u64 %rd3, [caller_St8x4_param_0+8];
24 ; CHECK-NEXT: st.u64 [%SP+8], %rd3;
25 ; CHECK-NEXT: ld.param.u64 %rd4, [caller_St8x4_param_0];
26 ; CHECK-NEXT: st.u64 [%SP], %rd4;
27 ; CHECK-NEXT: { // callseq 0, 0
28 ; CHECK-NEXT: .param .align 16 .b8 param0[32];
29 ; CHECK-NEXT: st.param.v2.b64 [param0], {%rd4, %rd3};
30 ; CHECK-NEXT: st.param.v2.b64 [param0+16], {%rd2, %rd1};
31 ; CHECK-NEXT: .param .align 16 .b8 retval0[32];
32 ; CHECK-NEXT: call.uni (retval0),
33 ; CHECK-NEXT: callee_St8x4,
37 ; CHECK-NEXT: ld.param.v2.b64 {%rd5, %rd6}, [retval0];
38 ; CHECK-NEXT: ld.param.v2.b64 {%rd7, %rd8}, [retval0+16];
39 ; CHECK-NEXT: } // callseq 0
40 ; CHECK-NEXT: st.u64 [%r1], %rd5;
41 ; CHECK-NEXT: st.u64 [%r1+8], %rd6;
42 ; CHECK-NEXT: st.u64 [%r1+16], %rd7;
43 ; CHECK-NEXT: st.u64 [%r1+24], %rd8;
45 %call = tail call fastcc [4 x i64] @callee_St8x4(ptr noundef nonnull byval(%struct.St8x4) align 8 %in) #2
46 %.fca.0.extract = extractvalue [4 x i64] %call, 0
47 %.fca.1.extract = extractvalue [4 x i64] %call, 1
48 %.fca.2.extract = extractvalue [4 x i64] %call, 2
49 %.fca.3.extract = extractvalue [4 x i64] %call, 3
50 store i64 %.fca.0.extract, ptr %ret, align 8
51 %ref.tmp.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %ret, i64 8
52 store i64 %.fca.1.extract, ptr %ref.tmp.sroa.4.0..sroa_idx, align 8
53 %ref.tmp.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %ret, i64 16
54 store i64 %.fca.2.extract, ptr %ref.tmp.sroa.5.0..sroa_idx, align 8
55 %ref.tmp.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %ret, i64 24
56 store i64 %.fca.3.extract, ptr %ref.tmp.sroa.6.0..sroa_idx, align 8
60 define internal fastcc [4 x i64] @callee_St8x4(ptr nocapture noundef readonly byval(%struct.St8x4) align 8 %in) {
61 ; CHECK-LABEL: callee_St8x4(
62 ; CHECK: // @callee_St8x4
64 ; CHECK-NEXT: .reg .b64 %rd<5>;
66 ; CHECK-NEXT: // %bb.0:
67 ; CHECK-NEXT: ld.param.v2.u64 {%rd1, %rd2}, [callee_St8x4_param_0];
68 ; CHECK-NEXT: ld.param.v2.u64 {%rd3, %rd4}, [callee_St8x4_param_0+16];
69 ; CHECK-NEXT: st.param.v2.b64 [func_retval0], {%rd1, %rd2};
70 ; CHECK-NEXT: st.param.v2.b64 [func_retval0+16], {%rd3, %rd4};
72 %1 = load i64, ptr %in, align 8
73 %arrayidx.1 = getelementptr inbounds [4 x i64], ptr %in, i64 0, i64 1
74 %2 = load i64, ptr %arrayidx.1, align 8
75 %arrayidx.2 = getelementptr inbounds [4 x i64], ptr %in, i64 0, i64 2
76 %3 = load i64, ptr %arrayidx.2, align 8
77 %arrayidx.3 = getelementptr inbounds [4 x i64], ptr %in, i64 0, i64 3
78 %4 = load i64, ptr %arrayidx.3, align 8
79 %5 = insertvalue [4 x i64] poison, i64 %1, 0
80 %6 = insertvalue [4 x i64] %5, i64 %2, 1
81 %7 = insertvalue [4 x i64] %6, i64 %3, 2
82 %oldret = insertvalue [4 x i64] %7, i64 %4, 3
86 define void @call_void() {
87 ; CHECK-LABEL: call_void(
91 ; CHECK-NEXT: // %bb.0: