1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -O0 -mtriple=amdgcn-amd-amdhsa -mcpu=gfx1031 -verify-machineinstrs < %s | FileCheck %s
4 ; Testcase which happened to trigger a liveness verifier error
5 define amdgpu_kernel void @test_long_add4(<4 x i64> %arg) #0 {
6 ; CHECK-LABEL: test_long_add4:
7 ; CHECK: ; %bb.0: ; %entry
8 ; CHECK-NEXT: s_mov_b64 s[4:5], 0
9 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
10 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
11 ; CHECK-NEXT: global_load_dwordx4 v[6:9], v[0:1], off
12 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
13 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
14 ; CHECK-NEXT: global_load_dwordx4 v[0:3], v[0:1], off offset:16
15 ; CHECK-NEXT: ; kill: def $vgpr6_vgpr7_vgpr8_vgpr9 killed $vgpr6_vgpr7_vgpr8_vgpr9 def $vgpr6_vgpr7_vgpr8_vgpr9_vgpr10_vgpr11_vgpr12_vgpr13 killed $exec
16 ; CHECK-NEXT: s_waitcnt vmcnt(0)
17 ; CHECK-NEXT: v_mov_b32_e32 v13, v3
18 ; CHECK-NEXT: v_mov_b32_e32 v12, v2
19 ; CHECK-NEXT: v_mov_b32_e32 v11, v1
20 ; CHECK-NEXT: v_mov_b32_e32 v10, v0
21 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
22 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
23 ; CHECK-NEXT: global_load_dwordx4 v[18:21], v[0:1], off
24 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
25 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
26 ; CHECK-NEXT: global_load_dwordx4 v[0:3], v[0:1], off offset:16
27 ; CHECK-NEXT: ; kill: def $vgpr18_vgpr19_vgpr20_vgpr21 killed $vgpr18_vgpr19_vgpr20_vgpr21 def $vgpr18_vgpr19_vgpr20_vgpr21_vgpr22_vgpr23_vgpr24_vgpr25 killed $exec
28 ; CHECK-NEXT: s_waitcnt vmcnt(0)
29 ; CHECK-NEXT: v_mov_b32_e32 v25, v3
30 ; CHECK-NEXT: v_mov_b32_e32 v24, v2
31 ; CHECK-NEXT: v_mov_b32_e32 v23, v1
32 ; CHECK-NEXT: v_mov_b32_e32 v22, v0
33 ; CHECK-NEXT: v_mov_b32_e32 v4, v6
34 ; CHECK-NEXT: v_mov_b32_e32 v5, v7
35 ; CHECK-NEXT: v_mov_b32_e32 v2, v8
36 ; CHECK-NEXT: v_mov_b32_e32 v3, v9
37 ; CHECK-NEXT: v_mov_b32_e32 v0, v10
38 ; CHECK-NEXT: v_mov_b32_e32 v1, v11
39 ; CHECK-NEXT: v_mov_b32_e32 v8, v12
40 ; CHECK-NEXT: v_mov_b32_e32 v9, v13
41 ; CHECK-NEXT: v_mov_b32_e32 v16, v18
42 ; CHECK-NEXT: v_mov_b32_e32 v17, v19
43 ; CHECK-NEXT: v_mov_b32_e32 v14, v20
44 ; CHECK-NEXT: v_mov_b32_e32 v15, v21
45 ; CHECK-NEXT: v_mov_b32_e32 v12, v22
46 ; CHECK-NEXT: v_mov_b32_e32 v13, v23
47 ; CHECK-NEXT: v_mov_b32_e32 v10, v24
48 ; CHECK-NEXT: v_mov_b32_e32 v11, v25
49 ; CHECK-NEXT: v_mov_b32_e32 v6, v4
50 ; CHECK-NEXT: v_mov_b32_e32 v4, v5
51 ; CHECK-NEXT: v_mov_b32_e32 v7, v16
52 ; CHECK-NEXT: v_mov_b32_e32 v5, v17
53 ; CHECK-NEXT: v_add_co_u32 v6, s6, v6, v7
54 ; CHECK-NEXT: v_add_co_ci_u32_e64 v4, s6, v4, v5, s6
55 ; CHECK-NEXT: ; kill: def $vgpr6 killed $vgpr6 def $vgpr6_vgpr7 killed $exec
56 ; CHECK-NEXT: v_mov_b32_e32 v7, v4
57 ; CHECK-NEXT: v_mov_b32_e32 v4, v2
58 ; CHECK-NEXT: v_mov_b32_e32 v2, v3
59 ; CHECK-NEXT: v_mov_b32_e32 v5, v14
60 ; CHECK-NEXT: v_mov_b32_e32 v3, v15
61 ; CHECK-NEXT: v_add_co_u32 v4, s6, v4, v5
62 ; CHECK-NEXT: v_add_co_ci_u32_e64 v2, s6, v2, v3, s6
63 ; CHECK-NEXT: ; kill: def $vgpr4 killed $vgpr4 def $vgpr4_vgpr5 killed $exec
64 ; CHECK-NEXT: v_mov_b32_e32 v5, v2
65 ; CHECK-NEXT: v_mov_b32_e32 v2, v0
66 ; CHECK-NEXT: v_mov_b32_e32 v0, v1
67 ; CHECK-NEXT: v_mov_b32_e32 v3, v12
68 ; CHECK-NEXT: v_mov_b32_e32 v1, v13
69 ; CHECK-NEXT: v_add_co_u32 v2, s6, v2, v3
70 ; CHECK-NEXT: v_add_co_ci_u32_e64 v0, s6, v0, v1, s6
71 ; CHECK-NEXT: ; kill: def $vgpr2 killed $vgpr2 def $vgpr2_vgpr3 killed $exec
72 ; CHECK-NEXT: v_mov_b32_e32 v3, v0
73 ; CHECK-NEXT: v_mov_b32_e32 v0, v8
74 ; CHECK-NEXT: v_mov_b32_e32 v1, v9
75 ; CHECK-NEXT: v_mov_b32_e32 v9, v10
76 ; CHECK-NEXT: v_mov_b32_e32 v8, v11
77 ; CHECK-NEXT: v_add_co_u32 v0, s6, v0, v9
78 ; CHECK-NEXT: v_add_co_ci_u32_e64 v8, s6, v1, v8, s6
79 ; CHECK-NEXT: ; kill: def $vgpr0 killed $vgpr0 def $vgpr0_vgpr1 killed $exec
80 ; CHECK-NEXT: v_mov_b32_e32 v1, v8
81 ; CHECK-NEXT: ; kill: def $vgpr6_vgpr7 killed $vgpr6_vgpr7 def $vgpr6_vgpr7_vgpr8_vgpr9 killed $exec
82 ; CHECK-NEXT: v_mov_b32_e32 v9, v5
83 ; CHECK-NEXT: v_mov_b32_e32 v8, v4
84 ; CHECK-NEXT: ; kill: def $vgpr2_vgpr3 killed $vgpr2_vgpr3 def $vgpr2_vgpr3_vgpr4_vgpr5 killed $exec
85 ; CHECK-NEXT: v_mov_b32_e32 v5, v1
86 ; CHECK-NEXT: v_mov_b32_e32 v4, v0
87 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
88 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
89 ; CHECK-NEXT: global_store_dwordx4 v[0:1], v[6:9], off
90 ; CHECK-NEXT: s_mov_b64 s[4:5], 16
91 ; CHECK-NEXT: v_mov_b32_e32 v0, s4
92 ; CHECK-NEXT: v_mov_b32_e32 v1, s5
93 ; CHECK-NEXT: global_store_dwordx4 v[0:1], v[2:5], off
94 ; CHECK-NEXT: s_endpgm
96 %load0 = load <4 x i64>, ptr addrspace(1) null, align 32
97 %load1 = load <4 x i64>, ptr addrspace(1) null, align 32
98 %add = add <4 x i64> %load0, %load1
99 store <4 x i64> %add, ptr addrspace(1) null, align 32
103 attributes #0 = { noinline optnone }