aboutsummaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/AMDGPU/issue130120-eliminate-frame-index.ll
blob: 1c298014e33e7b27a48fac70115e985dc1636741 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
; RUN: llc -mtriple=amdgcn -mcpu=gfx1100 < %s | FileCheck %s

define amdgpu_gfx [13 x i32] @issue130120() {
; CHECK-LABEL: issue130120:
; CHECK:       ; %bb.0: ; %bb
; CHECK-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
; CHECK-NEXT:    v_mov_b32_e32 v0, 0
; CHECK-NEXT:    s_add_i32 s0, s32, 0xf0
; CHECK-NEXT:    s_add_i32 s1, s32, 0xf4
; CHECK-NEXT:    s_add_i32 s2, s32, 0xf8
; CHECK-NEXT:    s_add_i32 s3, s32, 0xfc
; CHECK-NEXT:    v_mov_b32_e32 v1, v0
; CHECK-NEXT:    s_add_i32 s34, s32, 0x100
; CHECK-NEXT:    s_add_i32 s35, s32, 0x104
; CHECK-NEXT:    s_add_i32 s36, s32, 0x108
; CHECK-NEXT:    s_add_i32 s37, s32, 0x110
; CHECK-NEXT:    s_add_i32 s38, s32, 0x120
; CHECK-NEXT:    s_or_b32 s39, s32, 4
; CHECK-NEXT:    s_or_b32 s40, s32, 8
; CHECK-NEXT:    s_or_b32 s41, s32, 12
; CHECK-NEXT:    s_add_i32 s42, s32, 16
; CHECK-NEXT:    s_add_i32 s43, s32, 20
; CHECK-NEXT:    s_add_i32 s44, s32, 24
; CHECK-NEXT:    s_mov_b32 s46, 1
; CHECK-NEXT:    s_movk_i32 s45, 0x990
; CHECK-NEXT:    s_mov_b32 s48, 0
; CHECK-NEXT:  .LBB0_1: ; %bb3
; CHECK-NEXT:    ; =>This Inner Loop Header: Depth=1
; CHECK-NEXT:    s_cmp_eq_u32 s46, 0
; CHECK-NEXT:    s_mov_b32 s49, s48
; CHECK-NEXT:    s_mov_b32 s50, s48
; CHECK-NEXT:    s_cselect_b32 s51, 0, s1
; CHECK-NEXT:    s_cselect_b32 s55, 0, s35
; CHECK-NEXT:    v_dual_mov_b32 v2, s48 :: v_dual_mov_b32 v3, s49
; CHECK-NEXT:    s_cselect_b32 s52, 0, s2
; CHECK-NEXT:    s_cselect_b32 s56, 0, s36
; CHECK-NEXT:    s_cselect_b32 vcc_lo, 0, s43
; CHECK-NEXT:    v_mov_b32_e32 v4, s50
; CHECK-NEXT:    s_cselect_b32 s47, s45, 0xf0
; CHECK-NEXT:    s_cselect_b32 s53, 0, s3
; CHECK-NEXT:    s_cselect_b32 s54, 0, s34
; CHECK-NEXT:    s_cselect_b32 s57, 0, s37
; CHECK-NEXT:    s_cselect_b32 s58, 0, s38
; CHECK-NEXT:    s_cselect_b32 s59, 0, s0
; CHECK-NEXT:    s_cselect_b32 s60, 0, s39
; CHECK-NEXT:    s_cselect_b32 s61, 0, s40
; CHECK-NEXT:    s_cselect_b32 s62, 0, s41
; CHECK-NEXT:    s_cselect_b32 s63, 0, s42
; CHECK-NEXT:    s_cselect_b32 vcc_hi, 0, s44
; CHECK-NEXT:    s_mov_b32 s46, s48
; CHECK-NEXT:    scratch_store_b32 off, v0, s51
; CHECK-NEXT:    scratch_store_b32 off, v0, s52
; CHECK-NEXT:    scratch_store_b32 off, v0, s53
; CHECK-NEXT:    scratch_store_b32 off, v0, s54
; CHECK-NEXT:    scratch_store_b32 off, v0, s55
; CHECK-NEXT:    scratch_store_b64 off, v[0:1], s56
; CHECK-NEXT:    scratch_store_b32 off, v0, s57
; CHECK-NEXT:    scratch_store_b32 off, v0, s47
; CHECK-NEXT:    scratch_store_b96 off, v[2:4], s58
; CHECK-NEXT:    scratch_store_b96 off, v[2:4], s59
; CHECK-NEXT:    scratch_store_b32 off, v0, s60
; CHECK-NEXT:    scratch_store_b32 off, v0, s61
; CHECK-NEXT:    scratch_store_b32 off, v0, s62
; CHECK-NEXT:    scratch_store_b32 off, v0, s63
; CHECK-NEXT:    scratch_store_b32 off, v0, vcc_lo
; CHECK-NEXT:    scratch_store_b32 off, v0, vcc_hi
; CHECK-NEXT:    s_mov_b32 vcc_lo, exec_lo
; CHECK-NEXT:    s_cbranch_vccnz .LBB0_1
; CHECK-NEXT:  ; %bb.2: ; %DummyReturnBlock
; CHECK-NEXT:    s_setpc_b64 s[30:31]
bb:
  %i = alloca [8 x { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }], i32 0, align 16, addrspace(5)
  %i1 = getelementptr [8 x { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }], ptr addrspace(5) %i, i32 0, i32 0, i32 20
  %i2 = getelementptr [8 x { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }], ptr addrspace(5) %i, i32 0, i32 6, i32 20
  br label %bb3

bb3:                                              ; preds = %bb3, %bb
  %i4 = phi i32 [ 1, %bb ], [ 0, %bb3 ]
  %i5 = icmp eq i32 %i4, 0
  %i6 = select i1 %i5, ptr addrspace(5) %i2, ptr addrspace(5) %i1
  store i32 0, ptr addrspace(5) %i6, align 16
  %i7 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 1
  %i8 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i7
  store float 0.000000e+00, ptr addrspace(5) %i8, align 4
  %i9 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 2
  %i10 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i9
  store i32 0, ptr addrspace(5) %i10, align 8
  %i11 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 3
  %i12 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i11
  store i32 0, ptr addrspace(5) %i12, align 4
  %i13 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 4
  %i14 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i13
  store i32 0, ptr addrspace(5) %i14, align 16
  %i15 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 5
  %i16 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i15
  store i32 0, ptr addrspace(5) %i16, align 4
  %i17 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 6
  %i18 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i17
  store <2 x float> zeroinitializer, ptr addrspace(5) %i18, align 8
  %i19 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 7
  %i20 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i19
  store i32 0, ptr addrspace(5) %i20, align 16
  %i21 = getelementptr { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, ptr addrspace(5) %i1, i32 0, i32 8
  %i22 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i21
  store <3 x float> zeroinitializer, ptr addrspace(5) %i22, align 16
  %i23 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i1
  store <3 x float> zeroinitializer, ptr addrspace(5) %i23, align 16
  %i24 = getelementptr { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }, ptr addrspace(5) %i, i32 0, i32 1
  %i25 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i24
  store i32 0, ptr addrspace(5) %i25, align 4
  %i26 = getelementptr { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }, ptr addrspace(5) %i, i32 0, i32 2
  %i27 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i26
  store i32 0, ptr addrspace(5) %i27, align 8
  %i28 = getelementptr { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }, ptr addrspace(5) %i, i32 0, i32 3
  %i29 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i28
  store i32 0, ptr addrspace(5) %i29, align 4
  %i30 = getelementptr { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }, ptr addrspace(5) %i, i32 0, i32 4
  %i31 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i30
  store i32 0, ptr addrspace(5) %i31, align 16
  %i32 = getelementptr { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }, ptr addrspace(5) %i, i32 0, i32 5
  %i33 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i32
  store i32 0, ptr addrspace(5) %i33, align 4
  %i34 = getelementptr { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, { <3 x float>, float, <3 x float>, float }, float, i32, i32, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, { i32, float, i32, i32, i32, i32, <2 x float>, i32, <3 x float>, <3 x float> }, i32, i32, i32, i32, i32, i32, i32, i32, i32 }, ptr addrspace(5) %i, i32 0, i32 6
  %i35 = select i1 %i5, ptr addrspace(5) null, ptr addrspace(5) %i34
  store i32 0, ptr addrspace(5) %i35, align 8
  br label %bb3
}