@@ -205,8 +205,9 @@ define internal void @level1(i32 %C) {
205205; TUNIT-LABEL: define {{[^@]+}}@level1
206206; TUNIT-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
207207; 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]]
210211; TUNIT-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
211212; TUNIT-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
212213; TUNIT: if.then:
@@ -216,29 +217,31 @@ define internal void @level1(i32 %C) {
216217; TUNIT-NEXT: call void @level2b() #[[ATTR5]]
217218; TUNIT-NEXT: br label [[IF_END]]
218219; 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]]
220221; TUNIT-NEXT: ret void
221222;
222223; CGSCC: Function Attrs: norecurse nosync nounwind
223224; CGSCC-LABEL: define {{[^@]+}}@level1
224225; CGSCC-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
225226; 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]]
228230; CGSCC-NEXT: [[TOBOOL:%.*]] = icmp ne i32 [[C]], 0
229231; CGSCC-NEXT: br i1 [[TOBOOL]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
230232; 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]]
232234; CGSCC-NEXT: br label [[IF_END:%.*]]
233235; 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]]
235237; CGSCC-NEXT: br label [[IF_END]]
236238; 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]]
238240; CGSCC-NEXT: ret void
239241;
240242entry:
241- %local = alloca i32
243+ %local.alloca = alloca i32 , addrspace (5 )
244+ %local = addrspacecast ptr addrspace (5 ) %local.alloca to ptr
242245 call void @level2all_early (ptr %local )
243246 %tobool = icmp ne i32 %C , 0
244247 br i1 %tobool , label %if.then , label %if.else
@@ -259,9 +262,10 @@ if.end: ; preds = %if.else, %if.then
259262define internal void @level2all_early (ptr %addr ) {
260263; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
261264; 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]] {
263266; TUNIT-NEXT: entry:
264267; TUNIT-NEXT: store i32 1, ptr addrspace(3) @ReachableNonKernel, align 4
268+ ; TUNIT-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[ADDR]] to ptr addrspace(5)
265269; TUNIT-NEXT: ret void
266270;
267271; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
@@ -337,14 +341,15 @@ entry:
337341define internal void @level2all_late (ptr %addr ) {
338342; TUNIT: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
339343; 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]] {
341345; TUNIT-NEXT: entry:
342346; TUNIT-NEXT: store i32 1, ptr addrspace(3) @UnreachableNonKernel, align 4
347+ ; TUNIT-NEXT: [[TMP0:%.*]] = addrspacecast ptr [[ADDR]] to ptr addrspace(5)
343348; TUNIT-NEXT: ret void
344349;
345350; CGSCC: Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(write)
346351; 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]] {
348353; CGSCC-NEXT: entry:
349354; CGSCC-NEXT: store i32 1, ptr addrspace(3) @UnreachableNonKernel, align 4
350355; CGSCC-NEXT: store i32 5, ptr [[ADDR]], align 4
0 commit comments