Skip to content

Commit 173036a

Browse files
committed
[AMDGPU][NFC] Mark GEPs in flat offset folding tests as inbounds
This is in preparation for a patch that will only fold offsets into flat instructions if their addition is inbounds. For SWDEV-516125.
1 parent bd22087 commit 173036a

20 files changed

+1061
-1061
lines changed

Diff for: llvm/test/CodeGen/AMDGPU/atomics_cond_sub.ll

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ define amdgpu_kernel void @flat_atomic_cond_sub_no_rtn_u32(ptr %addr, i32 %in) {
2525
; GFX12-GISEL-NEXT: flat_atomic_cond_sub_u32 v0, v[0:1], v2 offset:-16 th:TH_ATOMIC_RETURN
2626
; GFX12-GISEL-NEXT: s_endpgm
2727
entry:
28-
%gep = getelementptr i32, ptr %addr, i32 -4
28+
%gep = getelementptr inbounds i32, ptr %addr, i32 -4
2929
%unused = call i32 @llvm.amdgcn.atomic.cond.sub.u32.p0(ptr %gep, i32 %in)
3030
ret void
3131
}
@@ -49,7 +49,7 @@ define amdgpu_kernel void @flat_atomic_cond_sub_no_rtn_u32_forced(ptr %addr, i32
4949
; GFX12-GISEL-NEXT: flat_atomic_cond_sub_u32 v[0:1], v2 offset:-16
5050
; GFX12-GISEL-NEXT: s_endpgm
5151
entry:
52-
%gep = getelementptr i32, ptr %addr, i32 -4
52+
%gep = getelementptr inbounds i32, ptr %addr, i32 -4
5353
%unused = call i32 @llvm.amdgcn.atomic.cond.sub.u32.p0(ptr %gep, i32 %in)
5454
ret void
5555
}
@@ -83,7 +83,7 @@ define amdgpu_kernel void @flat_atomic_cond_sub_rtn_u32(ptr %addr, i32 %in, ptr
8383
; GFX12-GISEL-NEXT: flat_store_b32 v[0:1], v2
8484
; GFX12-GISEL-NEXT: s_endpgm
8585
entry:
86-
%gep = getelementptr i32, ptr %addr, i32 4
86+
%gep = getelementptr inbounds i32, ptr %addr, i32 4
8787
%val = call i32 @llvm.amdgcn.atomic.cond.sub.u32.p0(ptr %gep, i32 %in)
8888
store i32 %val, ptr %use
8989
ret void

Diff for: llvm/test/CodeGen/AMDGPU/cgp-addressing-modes-flat.ll

+42-42
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
define void @test_sinkable_flat_small_offset_i32(ptr %out, ptr %in, i32 %cond) {
1313
; OPT-GFX7-LABEL: @test_sinkable_flat_small_offset_i32(
1414
; OPT-GFX7-NEXT: entry:
15-
; OPT-GFX7-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
16-
; OPT-GFX7-NEXT: [[IN_GEP:%.*]] = getelementptr i32, ptr [[IN:%.*]], i64 7
15+
; OPT-GFX7-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
16+
; OPT-GFX7-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i32, ptr [[IN:%.*]], i64 7
1717
; OPT-GFX7-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
1818
; OPT-GFX7-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
1919
; OPT-GFX7: if:
@@ -28,8 +28,8 @@ define void @test_sinkable_flat_small_offset_i32(ptr %out, ptr %in, i32 %cond) {
2828
;
2929
; OPT-GFX8-LABEL: @test_sinkable_flat_small_offset_i32(
3030
; OPT-GFX8-NEXT: entry:
31-
; OPT-GFX8-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
32-
; OPT-GFX8-NEXT: [[IN_GEP:%.*]] = getelementptr i32, ptr [[IN:%.*]], i64 7
31+
; OPT-GFX8-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
32+
; OPT-GFX8-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i32, ptr [[IN:%.*]], i64 7
3333
; OPT-GFX8-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
3434
; OPT-GFX8-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
3535
; OPT-GFX8: if:
@@ -44,11 +44,11 @@ define void @test_sinkable_flat_small_offset_i32(ptr %out, ptr %in, i32 %cond) {
4444
;
4545
; OPT-GFX9-LABEL: @test_sinkable_flat_small_offset_i32(
4646
; OPT-GFX9-NEXT: entry:
47-
; OPT-GFX9-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
47+
; OPT-GFX9-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
4848
; OPT-GFX9-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
4949
; OPT-GFX9-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
5050
; OPT-GFX9: if:
51-
; OPT-GFX9-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 28
51+
; OPT-GFX9-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 28
5252
; OPT-GFX9-NEXT: [[LOAD:%.*]] = load i32, ptr [[SUNKADDR]], align 4
5353
; OPT-GFX9-NEXT: br label [[ENDIF]]
5454
; OPT-GFX9: endif:
@@ -58,11 +58,11 @@ define void @test_sinkable_flat_small_offset_i32(ptr %out, ptr %in, i32 %cond) {
5858
;
5959
; OPT-GFX10-LABEL: @test_sinkable_flat_small_offset_i32(
6060
; OPT-GFX10-NEXT: entry:
61-
; OPT-GFX10-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
61+
; OPT-GFX10-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
6262
; OPT-GFX10-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
6363
; OPT-GFX10-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
6464
; OPT-GFX10: if:
65-
; OPT-GFX10-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 28
65+
; OPT-GFX10-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 28
6666
; OPT-GFX10-NEXT: [[LOAD:%.*]] = load i32, ptr [[SUNKADDR]], align 4
6767
; OPT-GFX10-NEXT: br label [[ENDIF]]
6868
; OPT-GFX10: endif:
@@ -146,8 +146,8 @@ define void @test_sinkable_flat_small_offset_i32(ptr %out, ptr %in, i32 %cond) {
146146
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
147147
; GFX10-NEXT: s_setpc_b64 s[30:31]
148148
entry:
149-
%out.gep = getelementptr i32, ptr %out, i64 999999
150-
%in.gep = getelementptr i32, ptr %in, i64 7
149+
%out.gep = getelementptr inbounds i32, ptr %out, i64 999999
150+
%in.gep = getelementptr inbounds i32, ptr %in, i64 7
151151
%cmp0 = icmp eq i32 %cond, 0
152152
br i1 %cmp0, label %endif, label %if
153153

@@ -167,12 +167,12 @@ done:
167167
define void @test_sink_noop_addrspacecast_flat_to_global_i32(ptr %out, ptr %in, i32 %cond) {
168168
; OPT-GFX7-LABEL: @test_sink_noop_addrspacecast_flat_to_global_i32(
169169
; OPT-GFX7-NEXT: entry:
170-
; OPT-GFX7-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
170+
; OPT-GFX7-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
171171
; OPT-GFX7-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
172172
; OPT-GFX7-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
173173
; OPT-GFX7: if:
174174
; OPT-GFX7-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[IN:%.*]] to ptr addrspace(1)
175-
; OPT-GFX7-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr addrspace(1) [[TMP0]], i64 28
175+
; OPT-GFX7-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0]], i64 28
176176
; OPT-GFX7-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(1) [[SUNKADDR]], align 4
177177
; OPT-GFX7-NEXT: br label [[ENDIF]]
178178
; OPT-GFX7: endif:
@@ -182,8 +182,8 @@ define void @test_sink_noop_addrspacecast_flat_to_global_i32(ptr %out, ptr %in,
182182
;
183183
; OPT-GFX8-LABEL: @test_sink_noop_addrspacecast_flat_to_global_i32(
184184
; OPT-GFX8-NEXT: entry:
185-
; OPT-GFX8-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
186-
; OPT-GFX8-NEXT: [[IN_GEP:%.*]] = getelementptr i32, ptr [[IN:%.*]], i64 7
185+
; OPT-GFX8-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
186+
; OPT-GFX8-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i32, ptr [[IN:%.*]], i64 7
187187
; OPT-GFX8-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
188188
; OPT-GFX8-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
189189
; OPT-GFX8: if:
@@ -197,12 +197,12 @@ define void @test_sink_noop_addrspacecast_flat_to_global_i32(ptr %out, ptr %in,
197197
;
198198
; OPT-GFX9-LABEL: @test_sink_noop_addrspacecast_flat_to_global_i32(
199199
; OPT-GFX9-NEXT: entry:
200-
; OPT-GFX9-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
200+
; OPT-GFX9-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
201201
; OPT-GFX9-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
202202
; OPT-GFX9-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
203203
; OPT-GFX9: if:
204204
; OPT-GFX9-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[IN:%.*]] to ptr addrspace(1)
205-
; OPT-GFX9-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr addrspace(1) [[TMP0]], i64 28
205+
; OPT-GFX9-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0]], i64 28
206206
; OPT-GFX9-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(1) [[SUNKADDR]], align 4
207207
; OPT-GFX9-NEXT: br label [[ENDIF]]
208208
; OPT-GFX9: endif:
@@ -212,12 +212,12 @@ define void @test_sink_noop_addrspacecast_flat_to_global_i32(ptr %out, ptr %in,
212212
;
213213
; OPT-GFX10-LABEL: @test_sink_noop_addrspacecast_flat_to_global_i32(
214214
; OPT-GFX10-NEXT: entry:
215-
; OPT-GFX10-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
215+
; OPT-GFX10-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
216216
; OPT-GFX10-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
217217
; OPT-GFX10-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
218218
; OPT-GFX10: if:
219219
; OPT-GFX10-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[IN:%.*]] to ptr addrspace(1)
220-
; OPT-GFX10-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr addrspace(1) [[TMP0]], i64 28
220+
; OPT-GFX10-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr addrspace(1) [[TMP0]], i64 28
221221
; OPT-GFX10-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(1) [[SUNKADDR]], align 4
222222
; OPT-GFX10-NEXT: br label [[ENDIF]]
223223
; OPT-GFX10: endif:
@@ -303,8 +303,8 @@ define void @test_sink_noop_addrspacecast_flat_to_global_i32(ptr %out, ptr %in,
303303
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
304304
; GFX10-NEXT: s_setpc_b64 s[30:31]
305305
entry:
306-
%out.gep = getelementptr i32, ptr %out, i64 999999
307-
%in.gep = getelementptr i32, ptr %in, i64 7
306+
%out.gep = getelementptr inbounds i32, ptr %out, i64 999999
307+
%in.gep = getelementptr inbounds i32, ptr %in, i64 7
308308
%cast = addrspacecast ptr %in.gep to ptr addrspace(1)
309309
%cmp0 = icmp eq i32 %cond, 0
310310
br i1 %cmp0, label %endif, label %if
@@ -325,12 +325,12 @@ done:
325325
define void @test_sink_noop_addrspacecast_flat_to_constant_i32(ptr %out, ptr %in, i32 %cond) {
326326
; OPT-LABEL: @test_sink_noop_addrspacecast_flat_to_constant_i32(
327327
; OPT-NEXT: entry:
328-
; OPT-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 999999
328+
; OPT-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 999999
329329
; OPT-NEXT: [[CMP0:%.*]] = icmp eq i32 [[COND:%.*]], 0
330330
; OPT-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
331331
; OPT: if:
332332
; OPT-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[IN:%.*]] to ptr addrspace(4)
333-
; OPT-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr addrspace(4) [[TMP0]], i64 28
333+
; OPT-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr addrspace(4) [[TMP0]], i64 28
334334
; OPT-NEXT: [[LOAD:%.*]] = load i32, ptr addrspace(4) [[SUNKADDR]], align 4
335335
; OPT-NEXT: br label [[ENDIF]]
336336
; OPT: endif:
@@ -416,8 +416,8 @@ define void @test_sink_noop_addrspacecast_flat_to_constant_i32(ptr %out, ptr %in
416416
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
417417
; GFX10-NEXT: s_setpc_b64 s[30:31]
418418
entry:
419-
%out.gep = getelementptr i32, ptr %out, i64 999999
420-
%in.gep = getelementptr i32, ptr %in, i64 7
419+
%out.gep = getelementptr inbounds i32, ptr %out, i64 999999
420+
%in.gep = getelementptr inbounds i32, ptr %in, i64 7
421421
%cast = addrspacecast ptr %in.gep to ptr addrspace(4)
422422
%cmp0 = icmp eq i32 %cond, 0
423423
br i1 %cmp0, label %endif, label %if
@@ -438,8 +438,8 @@ done:
438438
define void @test_sink_flat_small_max_flat_offset(ptr %out, ptr %in) #1 {
439439
; OPT-GFX7-LABEL: @test_sink_flat_small_max_flat_offset(
440440
; OPT-GFX7-NEXT: entry:
441-
; OPT-GFX7-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i32 1024
442-
; OPT-GFX7-NEXT: [[IN_GEP:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 4095
441+
; OPT-GFX7-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i32 1024
442+
; OPT-GFX7-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 4095
443443
; OPT-GFX7-NEXT: [[TID:%.*]] = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #[[ATTR3:[0-9]+]]
444444
; OPT-GFX7-NEXT: [[CMP0:%.*]] = icmp eq i32 [[TID]], 0
445445
; OPT-GFX7-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
@@ -456,8 +456,8 @@ define void @test_sink_flat_small_max_flat_offset(ptr %out, ptr %in) #1 {
456456
;
457457
; OPT-GFX8-LABEL: @test_sink_flat_small_max_flat_offset(
458458
; OPT-GFX8-NEXT: entry:
459-
; OPT-GFX8-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i32 1024
460-
; OPT-GFX8-NEXT: [[IN_GEP:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 4095
459+
; OPT-GFX8-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i32 1024
460+
; OPT-GFX8-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 4095
461461
; OPT-GFX8-NEXT: [[TID:%.*]] = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #[[ATTR3:[0-9]+]]
462462
; OPT-GFX8-NEXT: [[CMP0:%.*]] = icmp eq i32 [[TID]], 0
463463
; OPT-GFX8-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
@@ -474,12 +474,12 @@ define void @test_sink_flat_small_max_flat_offset(ptr %out, ptr %in) #1 {
474474
;
475475
; OPT-GFX9-LABEL: @test_sink_flat_small_max_flat_offset(
476476
; OPT-GFX9-NEXT: entry:
477-
; OPT-GFX9-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i32 1024
477+
; OPT-GFX9-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i32 1024
478478
; OPT-GFX9-NEXT: [[TID:%.*]] = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #[[ATTR3:[0-9]+]]
479479
; OPT-GFX9-NEXT: [[CMP0:%.*]] = icmp eq i32 [[TID]], 0
480480
; OPT-GFX9-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
481481
; OPT-GFX9: if:
482-
; OPT-GFX9-NEXT: [[SUNKADDR:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 4095
482+
; OPT-GFX9-NEXT: [[SUNKADDR:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 4095
483483
; OPT-GFX9-NEXT: [[LOAD:%.*]] = load i8, ptr [[SUNKADDR]], align 1
484484
; OPT-GFX9-NEXT: [[CAST:%.*]] = sext i8 [[LOAD]] to i32
485485
; OPT-GFX9-NEXT: br label [[ENDIF]]
@@ -490,8 +490,8 @@ define void @test_sink_flat_small_max_flat_offset(ptr %out, ptr %in) #1 {
490490
;
491491
; OPT-GFX10-LABEL: @test_sink_flat_small_max_flat_offset(
492492
; OPT-GFX10-NEXT: entry:
493-
; OPT-GFX10-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i32 1024
494-
; OPT-GFX10-NEXT: [[IN_GEP:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 4095
493+
; OPT-GFX10-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i32 1024
494+
; OPT-GFX10-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 4095
495495
; OPT-GFX10-NEXT: [[TID:%.*]] = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #[[ATTR3:[0-9]+]]
496496
; OPT-GFX10-NEXT: [[CMP0:%.*]] = icmp eq i32 [[TID]], 0
497497
; OPT-GFX10-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
@@ -588,8 +588,8 @@ define void @test_sink_flat_small_max_flat_offset(ptr %out, ptr %in) #1 {
588588
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
589589
; GFX10-NEXT: s_setpc_b64 s[30:31]
590590
entry:
591-
%out.gep = getelementptr i32, ptr %out, i32 1024
592-
%in.gep = getelementptr i8, ptr %in, i64 4095
591+
%out.gep = getelementptr inbounds i32, ptr %out, i32 1024
592+
%in.gep = getelementptr inbounds i8, ptr %in, i64 4095
593593
%tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
594594
%cmp0 = icmp eq i32 %tid, 0
595595
br i1 %cmp0, label %endif, label %if
@@ -611,8 +611,8 @@ done:
611611
define void @test_sink_flat_small_max_plus_1_flat_offset(ptr %out, ptr %in) #1 {
612612
; OPT-LABEL: @test_sink_flat_small_max_plus_1_flat_offset(
613613
; OPT-NEXT: entry:
614-
; OPT-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i64 99999
615-
; OPT-NEXT: [[IN_GEP:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 4096
614+
; OPT-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i64 99999
615+
; OPT-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 4096
616616
; OPT-NEXT: [[TID:%.*]] = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #[[ATTR3:[0-9]+]]
617617
; OPT-NEXT: [[CMP0:%.*]] = icmp eq i32 [[TID]], 0
618618
; OPT-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
@@ -711,8 +711,8 @@ define void @test_sink_flat_small_max_plus_1_flat_offset(ptr %out, ptr %in) #1 {
711711
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
712712
; GFX10-NEXT: s_setpc_b64 s[30:31]
713713
entry:
714-
%out.gep = getelementptr i32, ptr %out, i64 99999
715-
%in.gep = getelementptr i8, ptr %in, i64 4096
714+
%out.gep = getelementptr inbounds i32, ptr %out, i64 99999
715+
%in.gep = getelementptr inbounds i8, ptr %in, i64 4096
716716
%tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
717717
%cmp0 = icmp eq i32 %tid, 0
718718
br i1 %cmp0, label %endif, label %if
@@ -734,8 +734,8 @@ done:
734734
define void @test_sinkable_flat_reg_offset(ptr %out, ptr %in, i64 %reg) #1 {
735735
; OPT-LABEL: @test_sinkable_flat_reg_offset(
736736
; OPT-NEXT: entry:
737-
; OPT-NEXT: [[OUT_GEP:%.*]] = getelementptr i32, ptr [[OUT:%.*]], i32 1024
738-
; OPT-NEXT: [[IN_GEP:%.*]] = getelementptr i8, ptr [[IN:%.*]], i64 [[REG:%.*]]
737+
; OPT-NEXT: [[OUT_GEP:%.*]] = getelementptr inbounds i32, ptr [[OUT:%.*]], i32 1024
738+
; OPT-NEXT: [[IN_GEP:%.*]] = getelementptr inbounds i8, ptr [[IN:%.*]], i64 [[REG:%.*]]
739739
; OPT-NEXT: [[TID:%.*]] = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #[[ATTR3]]
740740
; OPT-NEXT: [[CMP0:%.*]] = icmp eq i32 [[TID]], 0
741741
; OPT-NEXT: br i1 [[CMP0]], label [[ENDIF:%.*]], label [[IF:%.*]]
@@ -834,8 +834,8 @@ define void @test_sinkable_flat_reg_offset(ptr %out, ptr %in, i64 %reg) #1 {
834834
; GFX10-NEXT: s_waitcnt lgkmcnt(0)
835835
; GFX10-NEXT: s_setpc_b64 s[30:31]
836836
entry:
837-
%out.gep = getelementptr i32, ptr %out, i32 1024
838-
%in.gep = getelementptr i8, ptr %in, i64 %reg
837+
%out.gep = getelementptr inbounds i32, ptr %out, i32 1024
838+
%in.gep = getelementptr inbounds i8, ptr %in, i64 %reg
839839
%tid = call i32 @llvm.amdgcn.mbcnt.lo(i32 -1, i32 0) #0
840840
%cmp0 = icmp eq i32 %tid, 0
841841
br i1 %cmp0, label %endif, label %if

0 commit comments

Comments
 (0)