@@ -205,8 +205,9 @@ define internal void @level1(i32 %C) {
205
205
; TUNIT-LABEL: define {{[^@]+}}@level1
206
206
; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
207
207
; TUNIT-NEXT: entry:
208
- ; TUNIT-NEXT: [[LOCAL:%.*]] = alloca i32, align 4
209
- ; TUNIT-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
208
+ ; TUNIT-NEXT: [[LOCAL_ALLOCA:%.*]] = alloca i32, align 4, addrspace(5)
209
+ ; TUNIT-NEXT: [[LOCAL:%.*]] = addrspacecast ptr addrspace(5) [[LOCAL_ALLOCA]] to ptr
210
+ ; TUNIT-NEXT: call void @level2all_early(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
210
211
; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
211
212
; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
212
213
; TUNIT: if.then:
@@ -216,29 +217,31 @@ define internal void @level1(i32 %C) {
216
217
; TUNIT-NEXT: call void @level2b() #[[ATTR5]]
217
218
; TUNIT-NEXT: br label [[IF_END]]
218
219
; TUNIT: if.end:
219
- ; TUNIT-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable (4) [[LOCAL]]) #[[ATTR6]]
220
+ ; TUNIT-NEXT: call void @level2all_late(ptr nocapture nofree noundef writeonly align 4 dereferenceable_or_null (4) [[LOCAL]]) #[[ATTR6]]
220
221
; TUNIT-NEXT: ret void
221
222
;
222
223
; CGSCC: Function Attrs: norecurse nosync nounwind
223
224
; CGSCC-LABEL: define {{[^@]+}}@level1
224
225
; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
225
226
; CGSCC-NEXT: entry:
226
- ; CGSCC-NEXT: [[LOCAL:%.*]] = alloca i32, align 4
227
- ; CGSCC-NEXT: call void @level2all_early(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]]
227
+ ; CGSCC-NEXT: [[LOCAL_ALLOCA:%.*]] = alloca i32, align 4, addrspace(5)
228
+ ; CGSCC-NEXT: [[LOCAL:%.*]] = addrspacecast ptr addrspace(5) [[LOCAL_ALLOCA]] to ptr
229
+ ; CGSCC-NEXT: call void @level2all_early(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR5]]
228
230
; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
229
231
; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
230
232
; CGSCC: if.then:
231
- ; CGSCC-NEXT: call void @level2a(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
233
+ ; CGSCC-NEXT: call void @level2a(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
232
234
; CGSCC-NEXT: br label [[IF_END:%.*]]
233
235
; CGSCC: if.else:
234
- ; CGSCC-NEXT: call void @level2b(ptr noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
236
+ ; CGSCC-NEXT: call void @level2b(ptr nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR4]]
235
237
; CGSCC-NEXT: br label [[IF_END]]
236
238
; CGSCC: if.end:
237
- ; CGSCC-NEXT: call void @level2all_late(ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR6]]
239
+ ; CGSCC-NEXT: call void @level2all_late(ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[LOCAL]]) #[[ATTR6]]
238
240
; CGSCC-NEXT: ret void
239
241
;
240
242
entry:
241
- %local = alloca i32
243
+ %local.alloca = alloca i32 , addrspace (5 )
244
+ %local = addrspacecast ptr addrspace (5 ) %local.alloca to ptr
242
245
call void @level2all_early (ptr %local )
243
246
%tobool = icmp ne i32 %C , 0
244
247
br i1 %tobool , label %if.then , label %if.else
@@ -259,9 +262,10 @@ if.end: ; preds = %if.else, %if.then
259
262
define internal void @level2all_early (ptr %addr ) {
260
263
; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
261
264
; TUNIT-LABEL: define {{[^@]+}}@level2all_early
262
- ; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
265
+ ; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
263
266
; TUNIT-NEXT: entry:
264
267
; TUNIT-NEXT: store i32 1, ptr addrspace(3) @ReachableNonKernel, align 4
268
+ ; TUNIT-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[ADDR]] to ptr addrspace(5)
265
269
; TUNIT-NEXT: ret void
266
270
;
267
271
; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
@@ -337,14 +341,15 @@ entry:
337
341
define internal void @level2all_late (ptr %addr ) {
338
342
; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
339
343
; TUNIT-LABEL: define {{[^@]+}}@level2all_late
340
- ; TUNIT-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
344
+ ; TUNIT-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
341
345
; TUNIT-NEXT: entry:
342
346
; TUNIT-NEXT: store i32 1, ptr addrspace(3) @UnreachableNonKernel, align 4
347
+ ; TUNIT-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[ADDR]] to ptr addrspace(5)
343
348
; TUNIT-NEXT: ret void
344
349
;
345
350
; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
346
351
; CGSCC-LABEL: define {{[^@]+}}@level2all_late
347
- ; CGSCC-SAME: (ptr noalias nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
352
+ ; CGSCC-SAME: (ptr nocapture nofree noundef nonnull writeonly align 4 dereferenceable(4) [[ADDR:%.*]]) #[[ATTR2]] {
348
353
; CGSCC-NEXT: entry:
349
354
; CGSCC-NEXT: store i32 1, ptr addrspace(3) @UnreachableNonKernel, align 4
350
355
; CGSCC-NEXT: store i32 5, ptr [[ADDR]], align 4
0 commit comments