1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --check-attributes --check-globals
2; RUN: opt -attributor -enable-new-pm=0 -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_NPM,NOT_CGSCC_OPM,NOT_TUNIT_NPM,IS__TUNIT____,IS________OPM,IS__TUNIT_OPM
3; RUN: opt -aa-pipeline=basic-aa -passes=attributor -attributor-manifest-internal  -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=13 -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_CGSCC_OPM,NOT_CGSCC_NPM,NOT_TUNIT_OPM,IS__TUNIT____,IS________NPM,IS__TUNIT_NPM
4; RUN: opt -attributor-cgscc -enable-new-pm=0 -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_NPM,IS__CGSCC____,IS________OPM,IS__CGSCC_OPM
5; RUN: opt -aa-pipeline=basic-aa -passes=attributor-cgscc -attributor-manifest-internal  -attributor-annotate-decl-cs -S < %s | FileCheck %s --check-prefixes=CHECK,NOT_TUNIT_NPM,NOT_TUNIT_OPM,NOT_CGSCC_OPM,IS__CGSCC____,IS________NPM,IS__CGSCC_NPM
6
7target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
8declare void @f(i32)
9declare token @llvm.call.preallocated.setup(i32)
10declare i8* @llvm.call.preallocated.arg(token, i32)
11
12@ConstAS3Ptr = addrspace(3) global i32 0, align 4
13
14;.
15; CHECK: @[[CONSTAS3PTR:[a-zA-Z0-9_$"\\.-]+]] = addrspace(3) global i32 0, align 4
16; CHECK: @[[S:[a-zA-Z0-9_$"\\.-]+]] = external global [[STRUCT_X:%.*]]
17; CHECK: @[[G:[a-zA-Z0-9_$"\\.-]+]] = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)* @f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] }
18;.
19define internal i32 addrspace(3)* @const_ptr_return_as3() {
20; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
21; IS__CGSCC____-LABEL: define {{[^@]+}}@const_ptr_return_as3
22; IS__CGSCC____-SAME: () #[[ATTR1:[0-9]+]] {
23; IS__CGSCC____-NEXT:    ret i32 addrspace(3)* @ConstAS3Ptr
24;
25  ret i32 addrspace(3)* @ConstAS3Ptr
26}
27define internal i32* @const_ptr_return() {
28; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
29; IS__CGSCC____-LABEL: define {{[^@]+}}@const_ptr_return
30; IS__CGSCC____-SAME: () #[[ATTR1]] {
31; IS__CGSCC____-NEXT:    ret i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*)
32;
33  ret i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*)
34}
35
36; Test1: Replace argument with constant
37define internal void @test1(i32 %a) {
38; CHECK-LABEL: define {{[^@]+}}@test1() {
39; CHECK-NEXT:    tail call void @f(i32 noundef 1)
40; CHECK-NEXT:    ret void
41;
42  tail call void @f(i32 %a)
43  ret void
44}
45
46define void @test1_helper() {
47; CHECK-LABEL: define {{[^@]+}}@test1_helper() {
48; CHECK-NEXT:    tail call void @test1()
49; CHECK-NEXT:    ret void
50;
51  tail call void @test1(i32 1)
52  ret void
53}
54
55; TEST 2 : Simplify return value
56define i32 @return0() {
57; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
58; CHECK-LABEL: define {{[^@]+}}@return0
59; CHECK-SAME: () #[[ATTR1:[0-9]+]] {
60; CHECK-NEXT:    ret i32 0
61;
62  ret i32 0
63}
64
65define i32 @return1() {
66; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
67; CHECK-LABEL: define {{[^@]+}}@return1
68; CHECK-SAME: () #[[ATTR1]] {
69; CHECK-NEXT:    ret i32 1
70;
71  ret i32 1
72}
73
74define i32 @test2_1(i1 %c) {
75; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
76; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_1
77; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
78; IS__TUNIT____-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
79; IS__TUNIT____:       if.true:
80; IS__TUNIT____-NEXT:    [[RET0:%.*]] = add i32 0, 1
81; IS__TUNIT____-NEXT:    br label [[END:%.*]]
82; IS__TUNIT____:       if.false:
83; IS__TUNIT____-NEXT:    br label [[END]]
84; IS__TUNIT____:       end:
85; IS__TUNIT____-NEXT:    [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ]
86; IS__TUNIT____-NEXT:    ret i32 1
87;
88; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
89; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2_1
90; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] {
91; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
92; IS__CGSCC_OPM:       if.true:
93; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = tail call i32 @return0() #[[ATTR13:[0-9]+]]
94; IS__CGSCC_OPM-NEXT:    [[RET0:%.*]] = add i32 [[CALL]], 1
95; IS__CGSCC_OPM-NEXT:    br label [[END:%.*]]
96; IS__CGSCC_OPM:       if.false:
97; IS__CGSCC_OPM-NEXT:    [[RET1:%.*]] = tail call i32 @return1() #[[ATTR13]]
98; IS__CGSCC_OPM-NEXT:    br label [[END]]
99; IS__CGSCC_OPM:       end:
100; IS__CGSCC_OPM-NEXT:    [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ [[RET1]], [[IF_FALSE]] ]
101; IS__CGSCC_OPM-NEXT:    ret i32 1
102;
103; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
104; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2_1
105; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] {
106; IS__CGSCC_NPM-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
107; IS__CGSCC_NPM:       if.true:
108; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = tail call i32 @return0() #[[ATTR12:[0-9]+]]
109; IS__CGSCC_NPM-NEXT:    [[RET0:%.*]] = add i32 [[CALL]], 1
110; IS__CGSCC_NPM-NEXT:    br label [[END:%.*]]
111; IS__CGSCC_NPM:       if.false:
112; IS__CGSCC_NPM-NEXT:    [[RET1:%.*]] = tail call i32 @return1() #[[ATTR12]]
113; IS__CGSCC_NPM-NEXT:    br label [[END]]
114; IS__CGSCC_NPM:       end:
115; IS__CGSCC_NPM-NEXT:    [[RET:%.*]] = phi i32 [ [[RET0]], [[IF_TRUE]] ], [ [[RET1]], [[IF_FALSE]] ]
116; IS__CGSCC_NPM-NEXT:    ret i32 1
117;
118  br i1 %c, label %if.true, label %if.false
119if.true:
120  %call = tail call i32 @return0()
121  %ret0 = add i32 %call, 1
122  br label %end
123if.false:
124  %ret1 = tail call i32 @return1()
125  br label %end
126end:
127
128  %ret = phi i32 [ %ret0, %if.true ], [ %ret1, %if.false ]
129
130  ret i32 1
131}
132
133
134
135define i32 @test2_2(i1 %c) {
136; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
137; IS__TUNIT____-LABEL: define {{[^@]+}}@test2_2
138; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
139; IS__TUNIT____-NEXT:    ret i32 1
140;
141; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
142; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test2_2
143; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
144; IS__CGSCC_OPM-NEXT:    [[RET:%.*]] = tail call noundef i32 @test2_1(i1 [[C]]) #[[ATTR13]]
145; IS__CGSCC_OPM-NEXT:    ret i32 [[RET]]
146;
147; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
148; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test2_2
149; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
150; IS__CGSCC_NPM-NEXT:    [[RET:%.*]] = tail call noundef i32 @test2_1(i1 [[C]]) #[[ATTR12]]
151; IS__CGSCC_NPM-NEXT:    ret i32 [[RET]]
152;
153  %ret = tail call i32 @test2_1(i1 %c)
154  ret i32 %ret
155}
156
157declare void @use(i32)
158define void @test3(i1 %c) {
159; IS__TUNIT____-LABEL: define {{[^@]+}}@test3
160; IS__TUNIT____-SAME: (i1 [[C:%.*]]) {
161; IS__TUNIT____-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
162; IS__TUNIT____:       if.true:
163; IS__TUNIT____-NEXT:    br label [[END:%.*]]
164; IS__TUNIT____:       if.false:
165; IS__TUNIT____-NEXT:    br label [[END]]
166; IS__TUNIT____:       end:
167; IS__TUNIT____-NEXT:    [[R:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ]
168; IS__TUNIT____-NEXT:    tail call void @use(i32 noundef 1)
169; IS__TUNIT____-NEXT:    ret void
170;
171; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test3
172; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) {
173; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
174; IS__CGSCC_OPM:       if.true:
175; IS__CGSCC_OPM-NEXT:    br label [[END:%.*]]
176; IS__CGSCC_OPM:       if.false:
177; IS__CGSCC_OPM-NEXT:    [[RET1:%.*]] = tail call i32 @return1() #[[ATTR13]]
178; IS__CGSCC_OPM-NEXT:    br label [[END]]
179; IS__CGSCC_OPM:       end:
180; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ [[RET1]], [[IF_FALSE]] ]
181; IS__CGSCC_OPM-NEXT:    tail call void @use(i32 noundef [[R]])
182; IS__CGSCC_OPM-NEXT:    ret void
183;
184; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test3
185; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) {
186; IS__CGSCC_NPM-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
187; IS__CGSCC_NPM:       if.true:
188; IS__CGSCC_NPM-NEXT:    br label [[END:%.*]]
189; IS__CGSCC_NPM:       if.false:
190; IS__CGSCC_NPM-NEXT:    [[RET1:%.*]] = tail call i32 @return1() #[[ATTR12]]
191; IS__CGSCC_NPM-NEXT:    br label [[END]]
192; IS__CGSCC_NPM:       end:
193; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ [[RET1]], [[IF_FALSE]] ]
194; IS__CGSCC_NPM-NEXT:    tail call void @use(i32 noundef [[R]])
195; IS__CGSCC_NPM-NEXT:    ret void
196;
197  br i1 %c, label %if.true, label %if.false
198if.true:
199  br label %end
200if.false:
201  %ret1 = tail call i32 @return1()
202  br label %end
203end:
204
205  %r = phi i32 [ 1, %if.true ], [ %ret1, %if.false ]
206
207  tail call void @use(i32 %r)
208  ret void
209}
210
211define void @test-select-phi(i1 %c) {
212; CHECK-LABEL: define {{[^@]+}}@test-select-phi
213; CHECK-SAME: (i1 [[C:%.*]]) {
214; CHECK-NEXT:    tail call void @use(i32 noundef 1)
215; CHECK-NEXT:    [[SELECT_NOT_SAME:%.*]] = select i1 [[C]], i32 1, i32 0
216; CHECK-NEXT:    tail call void @use(i32 noundef [[SELECT_NOT_SAME]])
217; CHECK-NEXT:    br i1 [[C]], label [[IF_TRUE:%.*]], label [[IF_FALSE:%.*]]
218; CHECK:       if-true:
219; CHECK-NEXT:    br label [[END:%.*]]
220; CHECK:       if-false:
221; CHECK-NEXT:    br label [[END]]
222; CHECK:       end:
223; CHECK-NEXT:    [[PHI_SAME:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ]
224; CHECK-NEXT:    [[PHI_NOT_SAME:%.*]] = phi i32 [ 0, [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ]
225; CHECK-NEXT:    [[PHI_SAME_PROP:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ 1, [[IF_FALSE]] ]
226; CHECK-NEXT:    [[PHI_SAME_UNDEF:%.*]] = phi i32 [ 1, [[IF_TRUE]] ], [ undef, [[IF_FALSE]] ]
227; CHECK-NEXT:    [[SELECT_NOT_SAME_UNDEF:%.*]] = select i1 [[C]], i32 [[PHI_NOT_SAME]], i32 undef
228; CHECK-NEXT:    tail call void @use(i32 noundef 1)
229; CHECK-NEXT:    tail call void @use(i32 noundef [[PHI_NOT_SAME]])
230; CHECK-NEXT:    tail call void @use(i32 noundef 1)
231; CHECK-NEXT:    tail call void @use(i32 1)
232; CHECK-NEXT:    tail call void @use(i32 [[SELECT_NOT_SAME_UNDEF]])
233; CHECK-NEXT:    ret void
234;
235  %select-same = select i1 %c, i32 1, i32 1
236  tail call void @use(i32 %select-same)
237
238  %select-not-same = select i1 %c, i32 1, i32 0
239  tail call void @use(i32 %select-not-same)
240  br i1 %c, label %if-true, label %if-false
241if-true:
242  br label %end
243if-false:
244  br label %end
245end:
246  %phi-same = phi i32 [ 1, %if-true ], [ 1, %if-false ]
247  %phi-not-same = phi i32 [ 0, %if-true ], [ 1, %if-false ]
248  %phi-same-prop = phi i32 [ 1, %if-true ], [ %select-same, %if-false ]
249  %phi-same-undef = phi i32 [ 1, %if-true ], [ undef, %if-false ]
250  %select-not-same-undef = select i1 %c, i32 %phi-not-same, i32 undef
251
252
253  tail call void @use(i32 %phi-same)
254
255  tail call void @use(i32 %phi-not-same)
256
257  tail call void @use(i32 %phi-same-prop)
258
259  tail call void @use(i32 %phi-same-undef)
260
261  tail call void @use(i32 %select-not-same-undef)
262
263  ret void
264
265}
266
267define i32 @ipccp1(i32 %a) {
268; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
269; CHECK-LABEL: define {{[^@]+}}@ipccp1
270; CHECK-SAME: (i32 returned [[A:%.*]]) #[[ATTR1]] {
271; CHECK-NEXT:    br i1 true, label [[T:%.*]], label [[F:%.*]]
272; CHECK:       t:
273; CHECK-NEXT:    ret i32 [[A]]
274; CHECK:       f:
275; CHECK-NEXT:    unreachable
276;
277  br i1 true, label %t, label %f
278t:
279  ret i32 %a
280f:
281  %r = call i32 @ipccp1(i32 5)
282  ret i32 %r
283}
284
285define internal i1 @ipccp2i(i1 %a) {
286; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
287; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2i
288; IS__CGSCC____-SAME: () #[[ATTR1]] {
289; IS__CGSCC____-NEXT:    br label [[T:%.*]]
290; IS__CGSCC____:       t:
291; IS__CGSCC____-NEXT:    ret i1 true
292; IS__CGSCC____:       f:
293; IS__CGSCC____-NEXT:    unreachable
294;
295  br i1 %a, label %t, label %f
296t:
297  ret i1 %a
298f:
299  %r = call i1 @ipccp2i(i1 false)
300  ret i1 %r
301}
302
303define i1 @ipccp2() {
304; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
305; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2
306; IS__TUNIT____-SAME: () #[[ATTR1]] {
307; IS__TUNIT____-NEXT:    ret i1 true
308;
309; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
310; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ipccp2
311; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
312; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call noundef i1 @ipccp2i() #[[ATTR13]]
313; IS__CGSCC_OPM-NEXT:    ret i1 [[R]]
314;
315; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
316; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp2
317; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
318; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call noundef i1 @ipccp2i() #[[ATTR12]]
319; IS__CGSCC_NPM-NEXT:    ret i1 [[R]]
320;
321  %r = call i1 @ipccp2i(i1 true)
322  ret i1 %r
323}
324
325define internal i1 @ipccp2ib(i1 %a) {
326; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
327; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp2ib
328; IS__CGSCC____-SAME: () #[[ATTR1]] {
329; IS__CGSCC____-NEXT:    br label [[T:%.*]]
330; IS__CGSCC____:       t:
331; IS__CGSCC____-NEXT:    ret i1 true
332; IS__CGSCC____:       f:
333; IS__CGSCC____-NEXT:    unreachable
334;
335  br i1 %a, label %t, label %f
336t:
337  ret i1 true
338f:
339  %r = call i1 @ipccp2ib(i1 false)
340  ret i1 %r
341}
342
343define i1 @ipccp2b() {
344; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
345; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp2b
346; IS__TUNIT____-SAME: () #[[ATTR1]] {
347; IS__TUNIT____-NEXT:    ret i1 true
348;
349; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
350; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ipccp2b
351; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
352; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call noundef i1 @ipccp2ib() #[[ATTR13]]
353; IS__CGSCC_OPM-NEXT:    ret i1 [[R]]
354;
355; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
356; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp2b
357; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
358; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call noundef i1 @ipccp2ib() #[[ATTR12]]
359; IS__CGSCC_NPM-NEXT:    ret i1 [[R]]
360;
361  %r = call i1 @ipccp2ib(i1 true)
362  ret i1 %r
363}
364
365define internal i32 @ipccp3i(i32 %a) {
366; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
367; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp3i
368; IS__CGSCC____-SAME: () #[[ATTR1]] {
369; IS__CGSCC____-NEXT:    br label [[T:%.*]]
370; IS__CGSCC____:       t:
371; IS__CGSCC____-NEXT:    ret i32 7
372; IS__CGSCC____:       f:
373; IS__CGSCC____-NEXT:    unreachable
374;
375  %c = icmp eq i32 %a, 7
376  br i1 %c, label %t, label %f
377t:
378  ret i32 %a
379f:
380  %r = call i32 @ipccp3i(i32 5)
381  ret i32 %r
382}
383
384define i32 @ipccp3() {
385; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
386; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp3
387; IS__TUNIT____-SAME: () #[[ATTR1]] {
388; IS__TUNIT____-NEXT:    ret i32 7
389;
390; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
391; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ipccp3
392; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
393; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call noundef i32 @ipccp3i() #[[ATTR13]]
394; IS__CGSCC_OPM-NEXT:    ret i32 [[R]]
395;
396; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
397; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp3
398; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
399; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call noundef i32 @ipccp3i() #[[ATTR12]]
400; IS__CGSCC_NPM-NEXT:    ret i32 [[R]]
401;
402  %r = call i32 @ipccp3i(i32 7)
403  ret i32 %r
404}
405
406define internal i32 @ipccp4ia(i1 %c) {
407; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
408; IS__CGSCC____-LABEL: define {{[^@]+}}@ipccp4ia
409; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
410; IS__CGSCC____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
411; IS__CGSCC____:       t:
412; IS__CGSCC____-NEXT:    ret i32 0
413; IS__CGSCC____:       f:
414; IS__CGSCC____-NEXT:    ret i32 1
415;
416  br i1 %c, label %t, label %f
417t:
418  ret i32 0
419f:
420  ret i32 1
421}
422define internal i32 @ipccp4ib(i32 %a) {
423; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
424; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ipccp4ib
425; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
426; IS__CGSCC_OPM-NEXT:    br label [[T:%.*]]
427; IS__CGSCC_OPM:       t:
428; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call noundef i32 @ipccp4ia(i1 noundef true) #[[ATTR13]]
429; IS__CGSCC_OPM-NEXT:    ret i32 [[R]]
430; IS__CGSCC_OPM:       f:
431; IS__CGSCC_OPM-NEXT:    unreachable
432;
433; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
434; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp4ib
435; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
436; IS__CGSCC_NPM-NEXT:    br label [[T:%.*]]
437; IS__CGSCC_NPM:       t:
438; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call noundef i32 @ipccp4ia(i1 noundef true) #[[ATTR12]]
439; IS__CGSCC_NPM-NEXT:    ret i32 [[R]]
440; IS__CGSCC_NPM:       f:
441; IS__CGSCC_NPM-NEXT:    unreachable
442;
443  %c = icmp eq i32 %a, 7
444  br i1 %c, label %t, label %f
445t:
446  %r = call i32 @ipccp4ia(i1 %c)
447  ret i32 %r
448f:
449  ret i32 1
450}
451
452define i32 @ipccp4(i1 %c) {
453; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
454; IS__TUNIT____-LABEL: define {{[^@]+}}@ipccp4
455; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
456; IS__TUNIT____-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
457; IS__TUNIT____:       t:
458; IS__TUNIT____-NEXT:    br label [[F]]
459; IS__TUNIT____:       f:
460; IS__TUNIT____-NEXT:    ret i32 0
461;
462; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
463; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ipccp4
464; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
465; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
466; IS__CGSCC_OPM:       t:
467; IS__CGSCC_OPM-NEXT:    br label [[F]]
468; IS__CGSCC_OPM:       f:
469; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call noundef i32 @ipccp4ib() #[[ATTR13]]
470; IS__CGSCC_OPM-NEXT:    ret i32 [[R]]
471;
472; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
473; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ipccp4
474; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
475; IS__CGSCC_NPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
476; IS__CGSCC_NPM:       t:
477; IS__CGSCC_NPM-NEXT:    br label [[F]]
478; IS__CGSCC_NPM:       f:
479; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call noundef i32 @ipccp4ib() #[[ATTR12]]
480; IS__CGSCC_NPM-NEXT:    ret i32 [[R]]
481;
482  br i1 %c, label %t, label %f
483t:
484  %q = call i32 @ipccp4ia(i1 undef)
485  br label %f
486f:
487  %r = call i32 @ipccp4ib(i32 7)
488  ret i32 %r
489}
490
491; Do not touch complicated arguments (for now)
492%struct.X = type { i8* }
493define internal i32* @test_inalloca(i32* inalloca(i32) %a) {
494; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
495; CHECK-LABEL: define {{[^@]+}}@test_inalloca
496; CHECK-SAME: (i32* noalias nofree nonnull returned writeonly inalloca(i32) dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
497; CHECK-NEXT:    ret i32* [[A]]
498;
499  ret i32* %a
500}
501define i32* @complicated_args_inalloca(i32* %arg) {
502; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
503; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_inalloca
504; IS__TUNIT_OPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] {
505; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR10:[0-9]+]]
506; IS__TUNIT_OPM-NEXT:    ret i32* [[CALL]]
507;
508; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
509; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca
510; IS__TUNIT_NPM-SAME: (i32* nofree readnone "no-capture-maybe-returned" [[ARG:%.*]]) #[[ATTR1]] {
511; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree writeonly inalloca(i32) "no-capture-maybe-returned" [[ARG]]) #[[ATTR9:[0-9]+]]
512; IS__TUNIT_NPM-NEXT:    ret i32* [[CALL]]
513;
514; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
515; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_inalloca
516; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull readnone dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] {
517; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree noundef nonnull writeonly inalloca(i32) dereferenceable(4) [[ARG]]) #[[ATTR13]]
518; IS__CGSCC_OPM-NEXT:    ret i32* [[CALL]]
519;
520; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
521; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_inalloca
522; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull readnone dereferenceable(4) [[ARG:%.*]]) #[[ATTR2]] {
523; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call noalias nonnull dereferenceable(4) i32* @test_inalloca(i32* noalias nofree noundef nonnull writeonly inalloca(i32) dereferenceable(4) [[ARG]]) #[[ATTR12]]
524; IS__CGSCC_NPM-NEXT:    ret i32* [[CALL]]
525;
526  %call = call i32* @test_inalloca(i32* inalloca(i32) %arg)
527  ret i32* %call
528}
529
530define internal i32* @test_preallocated(i32* preallocated(i32) %a) {
531; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
532; CHECK-LABEL: define {{[^@]+}}@test_preallocated
533; CHECK-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
534; CHECK-NEXT:    ret i32* [[A]]
535;
536  ret i32* %a
537}
538define i32* @complicated_args_preallocated() {
539; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
540; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
541; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] {
542; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR11:[0-9]+]]
543; IS__TUNIT_OPM-NEXT:    [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR10]] [ "preallocated"(token [[C]]) ]
544; IS__TUNIT_OPM-NEXT:    ret i32* [[CALL]]
545;
546; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
547; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
548; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] {
549; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR10:[0-9]+]]
550; IS__TUNIT_NPM-NEXT:    [[CALL:%.*]] = call noundef nonnull align 4294967296 dereferenceable(4) i32* @test_preallocated(i32* noalias nocapture nofree noundef writeonly preallocated(i32) align 4294967296 null) #[[ATTR9]] [ "preallocated"(token [[C]]) ]
551; IS__TUNIT_NPM-NEXT:    ret i32* [[CALL]]
552;
553; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
554; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
555; IS__CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] {
556; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR14:[0-9]+]]
557; IS__CGSCC_OPM-NEXT:    ret i32* null
558;
559; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
560; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
561; IS__CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] {
562; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR13:[0-9]+]]
563; IS__CGSCC_NPM-NEXT:    ret i32* null
564;
565  %c = call token @llvm.call.preallocated.setup(i32 1)
566  %call = call i32* @test_preallocated(i32* preallocated(i32) null) ["preallocated"(token %c)]
567  ret i32* %call
568}
569
570define internal void @test_sret(%struct.X* sret(%struct.X) %a, %struct.X** %b) {
571;
572; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
573; IS__TUNIT____-LABEL: define {{[^@]+}}@test_sret
574; IS__TUNIT____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR3:[0-9]+]] {
575; IS__TUNIT____-NEXT:    store %struct.X* [[A]], %struct.X** [[B]], align 8
576; IS__TUNIT____-NEXT:    ret void
577;
578; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
579; IS__CGSCC____-LABEL: define {{[^@]+}}@test_sret
580; IS__CGSCC____-SAME: (%struct.X* noalias nofree noundef nonnull writeonly sret([[STRUCT_X:%.*]]) align 4294967296 dereferenceable(8) [[A:%.*]], %struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR4:[0-9]+]] {
581; IS__CGSCC____-NEXT:    store %struct.X* [[A]], %struct.X** [[B]], align 8
582; IS__CGSCC____-NEXT:    ret void
583;
584  store %struct.X* %a, %struct.X** %b
585  ret void
586}
587; FIXME: Alignment and dereferenceability are not propagated to the argument
588define void @complicated_args_sret(%struct.X** %b) {
589;
590;
591; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
592; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_sret
593; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] {
594; IS__TUNIT_OPM-NEXT:    call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR12:[0-9]+]]
595; IS__TUNIT_OPM-NEXT:    ret void
596;
597; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
598; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret
599; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] {
600; IS__TUNIT_NPM-NEXT:    call void @test_sret(%struct.X* noalias nocapture nofree noundef writeonly sret([[STRUCT_X:%.*]]) align 4294967296 null, %struct.X** nocapture nofree writeonly align 8 [[B]]) #[[ATTR11:[0-9]+]]
601; IS__TUNIT_NPM-NEXT:    ret void
602;
603; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
604; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_sret
605; IS__CGSCC____-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR5:[0-9]+]] {
606; IS__CGSCC____-NEXT:    unreachable
607;
608  call void @test_sret(%struct.X* sret(%struct.X) null, %struct.X** %b)
609  ret void
610}
611
612define internal %struct.X* @test_nest(%struct.X* nest %a) {
613; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
614; IS__CGSCC____-LABEL: define {{[^@]+}}@test_nest
615; IS__CGSCC____-SAME: (%struct.X* nest noalias nocapture nofree readnone align 4294967296 [[A:%.*]]) #[[ATTR1]] {
616; IS__CGSCC____-NEXT:    ret %struct.X* null
617;
618  ret %struct.X* %a
619}
620define %struct.X* @complicated_args_nest() {
621; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
622; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_nest
623; IS__TUNIT____-SAME: () #[[ATTR1]] {
624; IS__TUNIT____-NEXT:    ret %struct.X* null
625;
626; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
627; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_nest
628; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
629; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noalias noundef align 4294967296 %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR13]]
630; IS__CGSCC_OPM-NEXT:    ret %struct.X* [[CALL]]
631;
632; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
633; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_nest
634; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
635; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call noalias noundef align 4294967296 %struct.X* @test_nest(%struct.X* noalias nocapture nofree noundef readnone align 4294967296 null) #[[ATTR12]]
636; IS__CGSCC_NPM-NEXT:    ret %struct.X* [[CALL]]
637;
638  %call = call %struct.X* @test_nest(%struct.X* null)
639  ret %struct.X* %call
640}
641
642@S = external global %struct.X
643define internal void @test_byval(%struct.X* byval(%struct.X) %a) {
644; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
645; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_byval
646; IS__TUNIT_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] {
647; IS__TUNIT_OPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0
648; IS__TUNIT_OPM-NEXT:    store i8* null, i8** [[G0]], align 8
649; IS__TUNIT_OPM-NEXT:    ret void
650;
651; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
652; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval
653; IS__TUNIT_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR3]] {
654; IS__TUNIT_NPM-NEXT:    [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8
655; IS__TUNIT_NPM-NEXT:    [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8**
656; IS__TUNIT_NPM-NEXT:    store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8
657; IS__TUNIT_NPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0
658; IS__TUNIT_NPM-NEXT:    store i8* null, i8** [[G0]], align 8
659; IS__TUNIT_NPM-NEXT:    ret void
660;
661; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
662; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_byval
663; IS__CGSCC_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] {
664; IS__CGSCC_OPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0
665; IS__CGSCC_OPM-NEXT:    store i8* null, i8** [[G0]], align 8
666; IS__CGSCC_OPM-NEXT:    ret void
667;
668; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
669; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_byval
670; IS__CGSCC_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR4]] {
671; IS__CGSCC_NPM-NEXT:    [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8
672; IS__CGSCC_NPM-NEXT:    [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8**
673; IS__CGSCC_NPM-NEXT:    store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8
674; IS__CGSCC_NPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0
675; IS__CGSCC_NPM-NEXT:    store i8* null, i8** [[G0]], align 8
676; IS__CGSCC_NPM-NEXT:    ret void
677;
678  %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0
679  store i8* null, i8** %g0
680  ret void
681}
682define void @complicated_args_byval() {
683; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
684; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval
685; IS__TUNIT_OPM-SAME: () #[[ATTR4:[0-9]+]] {
686; IS__TUNIT_OPM-NEXT:    call void @test_byval(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR12]]
687; IS__TUNIT_OPM-NEXT:    ret void
688;
689; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
690; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval
691; IS__TUNIT_NPM-SAME: () #[[ATTR4:[0-9]+]] {
692; IS__TUNIT_NPM-NEXT:    [[S_CAST:%.*]] = bitcast %struct.X* @S to i8**
693; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8
694; IS__TUNIT_NPM-NEXT:    call void @test_byval(i8* [[TMP1]]) #[[ATTR11]]
695; IS__TUNIT_NPM-NEXT:    ret void
696;
697; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
698; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval
699; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
700; IS__CGSCC_OPM-NEXT:    call void @test_byval(%struct.X* noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR15:[0-9]+]]
701; IS__CGSCC_OPM-NEXT:    ret void
702;
703; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
704; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval
705; IS__CGSCC_NPM-SAME: () #[[ATTR3]] {
706; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8
707; IS__CGSCC_NPM-NEXT:    call void @test_byval(i8* nofree writeonly [[TMP1]]) #[[ATTR14:[0-9]+]]
708; IS__CGSCC_NPM-NEXT:    ret void
709;
710  call void @test_byval(%struct.X* byval(%struct.X) @S)
711  ret void
712}
713
714declare void @sync()
715; Make sure we *do not* load @S here!
716define internal i8*@test_byval2(%struct.X* byval(%struct.X) %a) {
717; IS________OPM-LABEL: define {{[^@]+}}@test_byval2
718; IS________OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) {
719; IS________OPM-NEXT:    call void @sync()
720; IS________OPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0
721; IS________OPM-NEXT:    [[L:%.*]] = load i8*, i8** [[G0]], align 8
722; IS________OPM-NEXT:    ret i8* [[L]]
723;
724; IS________NPM-LABEL: define {{[^@]+}}@test_byval2
725; IS________NPM-SAME: (i8* [[TMP0:%.*]]) {
726; IS________NPM-NEXT:    [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8
727; IS________NPM-NEXT:    [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8**
728; IS________NPM-NEXT:    store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8
729; IS________NPM-NEXT:    call void @sync()
730; IS________NPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0
731; IS________NPM-NEXT:    [[L:%.*]] = load i8*, i8** [[G0]], align 8
732; IS________NPM-NEXT:    ret i8* [[L]]
733;
734  call void @sync()
735  %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0
736  %l = load i8*, i8** %g0
737  ret i8* %l
738}
739define i8* @complicated_args_byval2() {
740;
741; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
742; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S)
743; IS__TUNIT_OPM-NEXT:    ret i8* [[C]]
744;
745; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
746; IS__TUNIT_NPM-NEXT:    [[S_CAST:%.*]] = bitcast %struct.X* @S to i8**
747; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8
748; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]])
749; IS__TUNIT_NPM-NEXT:    ret i8* [[C]]
750;
751; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
752; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(%struct.X* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S)
753; IS__CGSCC_OPM-NEXT:    ret i8* [[C]]
754;
755; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
756; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8
757; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]])
758; IS__CGSCC_NPM-NEXT:    ret i8* [[C]]
759;
760  %c = call i8* @test_byval2(%struct.X* byval(%struct.X) @S)
761  ret i8* %c
762}
763
764define void @fixpoint_changed(i32* %p) {
765; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly
766; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fixpoint_changed
767; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR5:[0-9]+]] {
768; IS__TUNIT_OPM-NEXT:  entry:
769; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
770; IS__TUNIT_OPM:       for.cond:
771; IS__TUNIT_OPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
772; IS__TUNIT_OPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
773; IS__TUNIT_OPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
774; IS__TUNIT_OPM:       for.body:
775; IS__TUNIT_OPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
776; IS__TUNIT_OPM-NEXT:    i32 1, label [[SW_BB:%.*]]
777; IS__TUNIT_OPM-NEXT:    ]
778; IS__TUNIT_OPM:       sw.bb:
779; IS__TUNIT_OPM-NEXT:    br label [[SW_EPILOG]]
780; IS__TUNIT_OPM:       sw.epilog:
781; IS__TUNIT_OPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
782; IS__TUNIT_OPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
783; IS__TUNIT_OPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
784; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]]
785; IS__TUNIT_OPM:       for.end:
786; IS__TUNIT_OPM-NEXT:    ret void
787;
788; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
789; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed
790; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] {
791; IS__TUNIT_NPM-NEXT:  entry:
792; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND:%.*]]
793; IS__TUNIT_NPM:       for.cond:
794; IS__TUNIT_NPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
795; IS__TUNIT_NPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
796; IS__TUNIT_NPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
797; IS__TUNIT_NPM:       for.body:
798; IS__TUNIT_NPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
799; IS__TUNIT_NPM-NEXT:    i32 1, label [[SW_BB:%.*]]
800; IS__TUNIT_NPM-NEXT:    ]
801; IS__TUNIT_NPM:       sw.bb:
802; IS__TUNIT_NPM-NEXT:    br label [[SW_EPILOG]]
803; IS__TUNIT_NPM:       sw.epilog:
804; IS__TUNIT_NPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
805; IS__TUNIT_NPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
806; IS__TUNIT_NPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
807; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND]]
808; IS__TUNIT_NPM:       for.end:
809; IS__TUNIT_NPM-NEXT:    ret void
810;
811; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly
812; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fixpoint_changed
813; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR6:[0-9]+]] {
814; IS__CGSCC_OPM-NEXT:  entry:
815; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
816; IS__CGSCC_OPM:       for.cond:
817; IS__CGSCC_OPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
818; IS__CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
819; IS__CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
820; IS__CGSCC_OPM:       for.body:
821; IS__CGSCC_OPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
822; IS__CGSCC_OPM-NEXT:    i32 1, label [[SW_BB:%.*]]
823; IS__CGSCC_OPM-NEXT:    ]
824; IS__CGSCC_OPM:       sw.bb:
825; IS__CGSCC_OPM-NEXT:    br label [[SW_EPILOG]]
826; IS__CGSCC_OPM:       sw.epilog:
827; IS__CGSCC_OPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
828; IS__CGSCC_OPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
829; IS__CGSCC_OPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
830; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]]
831; IS__CGSCC_OPM:       for.end:
832; IS__CGSCC_OPM-NEXT:    ret void
833;
834; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
835; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fixpoint_changed
836; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] {
837; IS__CGSCC_NPM-NEXT:  entry:
838; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND:%.*]]
839; IS__CGSCC_NPM:       for.cond:
840; IS__CGSCC_NPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
841; IS__CGSCC_NPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
842; IS__CGSCC_NPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
843; IS__CGSCC_NPM:       for.body:
844; IS__CGSCC_NPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
845; IS__CGSCC_NPM-NEXT:    i32 1, label [[SW_BB:%.*]]
846; IS__CGSCC_NPM-NEXT:    ]
847; IS__CGSCC_NPM:       sw.bb:
848; IS__CGSCC_NPM-NEXT:    br label [[SW_EPILOG]]
849; IS__CGSCC_NPM:       sw.epilog:
850; IS__CGSCC_NPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
851; IS__CGSCC_NPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
852; IS__CGSCC_NPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
853; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND]]
854; IS__CGSCC_NPM:       for.end:
855; IS__CGSCC_NPM-NEXT:    ret void
856;
857entry:
858  br label %for.cond
859
860for.cond:
861  %j.0 = phi i32 [ 0, %entry ], [ %inc, %sw.epilog ]
862  %cmp = icmp slt i32 %j.0, 30
863  br i1 %cmp, label %for.body, label %for.end
864
865for.body:
866  switch i32 %j.0, label %sw.epilog [
867  i32 1, label %sw.bb
868  ]
869
870sw.bb:
871  br label %sw.epilog
872
873sw.epilog:
874  %x.0 = phi i32 [ 255, %for.body ], [ 253, %sw.bb ]
875  store i32 %x.0, i32* %p
876  %inc = add nsw i32 %j.0, 1
877  br label %for.cond
878
879for.end:
880  ret void
881}
882
883; Check we merge undef and a constant properly.
884define i8 @caller0() {
885; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
886; IS__TUNIT____-LABEL: define {{[^@]+}}@caller0
887; IS__TUNIT____-SAME: () #[[ATTR1]] {
888; IS__TUNIT____-NEXT:    ret i8 49
889;
890; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
891; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller0
892; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
893; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]]
894; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
895;
896; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
897; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller0
898; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
899; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
900; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
901;
902  %c = call i8 @callee(i8 undef)
903  ret i8 %c
904}
905define i8 @caller1() {
906; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
907; IS__TUNIT____-LABEL: define {{[^@]+}}@caller1
908; IS__TUNIT____-SAME: () #[[ATTR1]] {
909; IS__TUNIT____-NEXT:    ret i8 49
910;
911; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
912; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller1
913; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
914; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]]
915; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
916;
917; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
918; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller1
919; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
920; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
921; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
922;
923  %c = call i8 @callee(i8 undef)
924  ret i8 %c
925}
926define i8 @caller2() {
927; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
928; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2
929; IS__TUNIT____-SAME: () #[[ATTR1]] {
930; IS__TUNIT____-NEXT:    ret i8 49
931;
932; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
933; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller2
934; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
935; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]]
936; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
937;
938; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
939; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller2
940; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
941; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
942; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
943;
944  %c = call i8 @callee(i8 undef)
945  ret i8 %c
946}
947define i8 @caller_middle() {
948; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
949; IS__TUNIT____-LABEL: define {{[^@]+}}@caller_middle
950; IS__TUNIT____-SAME: () #[[ATTR1]] {
951; IS__TUNIT____-NEXT:    ret i8 49
952;
953; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
954; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller_middle
955; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
956; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]]
957; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
958;
959; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
960; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller_middle
961; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
962; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
963; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
964;
965  %c = call i8 @callee(i8 42)
966  ret i8 %c
967}
968define i8 @caller3() {
969; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
970; IS__TUNIT____-LABEL: define {{[^@]+}}@caller3
971; IS__TUNIT____-SAME: () #[[ATTR1]] {
972; IS__TUNIT____-NEXT:    ret i8 49
973;
974; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
975; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller3
976; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
977; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]]
978; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
979;
980; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
981; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller3
982; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
983; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
984; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
985;
986  %c = call i8 @callee(i8 undef)
987  ret i8 %c
988}
989define i8 @caller4() {
990; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
991; IS__TUNIT____-LABEL: define {{[^@]+}}@caller4
992; IS__TUNIT____-SAME: () #[[ATTR1]] {
993; IS__TUNIT____-NEXT:    ret i8 49
994;
995; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
996; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller4
997; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
998; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR13]]
999; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
1000;
1001; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1002; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller4
1003; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
1004; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
1005; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
1006;
1007  %c = call i8 @callee(i8 undef)
1008  ret i8 %c
1009}
1010define internal i8 @callee(i8 %a) {
1011; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1012; IS__CGSCC____-LABEL: define {{[^@]+}}@callee
1013; IS__CGSCC____-SAME: () #[[ATTR1]] {
1014; IS__CGSCC____-NEXT:    ret i8 49
1015;
1016  %c = add i8 %a, 7
1017  ret i8 %c
1018}
1019
1020define void @user_as3() {
1021; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1022; IS__TUNIT____-LABEL: define {{[^@]+}}@user_as3
1023; IS__TUNIT____-SAME: () #[[ATTR4:[0-9]+]] {
1024; IS__TUNIT____-NEXT:    store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4
1025; IS__TUNIT____-NEXT:    ret void
1026;
1027; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1028; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user_as3
1029; IS__CGSCC_OPM-SAME: () #[[ATTR7:[0-9]+]] {
1030; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32 addrspace(3)* @const_ptr_return_as3() #[[ATTR13]]
1031; IS__CGSCC_OPM-NEXT:    store i32 0, i32 addrspace(3)* [[CALL]], align 4
1032; IS__CGSCC_OPM-NEXT:    ret void
1033;
1034; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1035; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user_as3
1036; IS__CGSCC_NPM-SAME: () #[[ATTR6:[0-9]+]] {
1037; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32 addrspace(3)* @const_ptr_return_as3() #[[ATTR12]]
1038; IS__CGSCC_NPM-NEXT:    store i32 0, i32 addrspace(3)* [[CALL]], align 4
1039; IS__CGSCC_NPM-NEXT:    ret void
1040;
1041  %call = call fastcc i32 addrspace(3)* @const_ptr_return_as3()
1042  store i32 0, i32 addrspace(3)* %call
1043  ret void
1044}
1045define void @user() {
1046; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1047; IS__TUNIT____-LABEL: define {{[^@]+}}@user
1048; IS__TUNIT____-SAME: () #[[ATTR4]] {
1049; IS__TUNIT____-NEXT:    store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4
1050; IS__TUNIT____-NEXT:    ret void
1051;
1052; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1053; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user
1054; IS__CGSCC_OPM-SAME: () #[[ATTR7]] {
1055; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32* @const_ptr_return() #[[ATTR13]]
1056; IS__CGSCC_OPM-NEXT:    store i32 0, i32* [[CALL]], align 4
1057; IS__CGSCC_OPM-NEXT:    ret void
1058;
1059; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1060; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user
1061; IS__CGSCC_NPM-SAME: () #[[ATTR6]] {
1062; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32* @const_ptr_return() #[[ATTR12]]
1063; IS__CGSCC_NPM-NEXT:    store i32 0, i32* [[CALL]], align 4
1064; IS__CGSCC_NPM-NEXT:    ret void
1065;
1066  %call = call fastcc i32* @const_ptr_return()
1067  store i32 0, i32* %call
1068  ret void
1069}
1070
1071
1072define i1 @test_merge_with_undef_values_ptr(i1 %c) {
1073; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1074; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
1075; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1076; IS__TUNIT____-NEXT:    ret i1 false
1077;
1078; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1079; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
1080; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1081; IS__CGSCC_OPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR13]]
1082; IS__CGSCC_OPM-NEXT:    ret i1 [[R1]]
1083;
1084; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1085; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
1086; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1087; IS__CGSCC_NPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR12]]
1088; IS__CGSCC_NPM-NEXT:    ret i1 [[R1]]
1089;
1090  %r1 = call i1 @undef_then_null(i1 %c, i32* undef, i32* undef)
1091  ret i1 %r1
1092}
1093define internal i1 @undef_then_null(i1 %c, i32* %i32Aptr, i32* %i32Bptr) {
1094; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
1095; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_null
1096; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR2:[0-9]+]] {
1097; IS__CGSCC____-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
1098; IS__CGSCC____:       a:
1099; IS__CGSCC____-NEXT:    ret i1 false
1100; IS__CGSCC____:       b:
1101; IS__CGSCC____-NEXT:    ret i1 false
1102;
1103  %cmp1 = icmp eq i32* %i32Aptr, %i32Bptr
1104  %cmp2 = icmp eq i1 %cmp1, false
1105  %or = or i1 %cmp2, %c
1106  br i1 %or, label %a, label %b
1107a:
1108  %r2 = call i1 @undef_then_null(i1 false, i32* null, i32* null)
1109  ret i1 %r2
1110b:
1111  ret i1 %cmp2
1112}
1113
1114define i1 @test_merge_with_undef_values(i1 %c) {
1115; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1116; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values
1117; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1118; IS__TUNIT____-NEXT:    ret i1 false
1119;
1120; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1121; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values
1122; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1123; IS__CGSCC_OPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR13]]
1124; IS__CGSCC_OPM-NEXT:    ret i1 [[R1]]
1125;
1126; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1127; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values
1128; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1129; IS__CGSCC_NPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR12]]
1130; IS__CGSCC_NPM-NEXT:    ret i1 [[R1]]
1131;
1132  %r1 = call i1 @undef_then_1(i1 %c, i32 undef, i32 undef)
1133  ret i1 %r1
1134}
1135define internal i1 @undef_then_1(i1 %c, i32 %i32A, i32 %i32B) {
1136;
1137; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
1138; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_1
1139; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1140; IS__CGSCC____-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
1141; IS__CGSCC____:       a:
1142; IS__CGSCC____-NEXT:    ret i1 false
1143; IS__CGSCC____:       b:
1144; IS__CGSCC____-NEXT:    ret i1 false
1145;
1146  %cmp1 = icmp eq i32 %i32A, %i32B
1147  %cmp2 = icmp eq i1 %cmp1, false
1148  %or = or i1 %cmp2, %c
1149  br i1 %or, label %a, label %b
1150a:
1151  %r2 = call i1 @undef_then_1(i1 false, i32 1, i32 1)
1152  ret i1 %r2
1153b:
1154  ret i1 %cmp2
1155}
1156
1157define i32 @test_select(i32 %c) {
1158; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1159; IS__TUNIT____-LABEL: define {{[^@]+}}@test_select
1160; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
1161; IS__TUNIT____-NEXT:    ret i32 42
1162;
1163; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1164; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_select
1165; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] {
1166; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noundef i32 @select() #[[ATTR13]]
1167; IS__CGSCC_OPM-NEXT:    ret i32 [[CALL]]
1168;
1169; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1170; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_select
1171; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] {
1172; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call noundef i32 @select() #[[ATTR12]]
1173; IS__CGSCC_NPM-NEXT:    ret i32 [[CALL]]
1174;
1175  %call = call i32 @select(i1 1, i32 42, i32 %c)
1176  ret i32 %call
1177}
1178
1179define internal i32 @select(i1 %a, i32 %b, i32 %c) {
1180; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1181; IS__CGSCC____-LABEL: define {{[^@]+}}@select
1182; IS__CGSCC____-SAME: () #[[ATTR1]] {
1183; IS__CGSCC____-NEXT:    ret i32 42
1184;
1185  %s = select i1 %a, i32 %b, i32 %c
1186  ret i32 %s
1187}
1188
1189define i1 @icmp() {
1190; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1191; CHECK-LABEL: define {{[^@]+}}@icmp
1192; CHECK-SAME: () #[[ATTR1]] {
1193; CHECK-NEXT:    ret i1 true
1194;
1195  %c = icmp eq i8* null, null
1196  ret i1 %c
1197}
1198
1199define void @test_callee_is_undef(void (i32)* %fn) {
1200; IS__TUNIT____-LABEL: define {{[^@]+}}@test_callee_is_undef
1201; IS__TUNIT____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) {
1202; IS__TUNIT____-NEXT:    call void @callee_is_undef()
1203; IS__TUNIT____-NEXT:    call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]])
1204; IS__TUNIT____-NEXT:    ret void
1205;
1206; IS__CGSCC____-LABEL: define {{[^@]+}}@test_callee_is_undef
1207; IS__CGSCC____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) {
1208; IS__CGSCC____-NEXT:    call void @callee_is_undef()
1209; IS__CGSCC____-NEXT:    call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree noundef nonnull [[FN]])
1210; IS__CGSCC____-NEXT:    ret void
1211;
1212  call void @callee_is_undef(void ()* undef)
1213  call void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 undef)
1214  ret void
1215}
1216define internal void @callee_is_undef(void ()* %fn) {
1217;
1218; CHECK-LABEL: define {{[^@]+}}@callee_is_undef() {
1219; CHECK-NEXT:    call void poison()
1220; CHECK-NEXT:    ret void
1221;
1222  call void %fn()
1223  ret void
1224}
1225define internal void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 %arg) {
1226;
1227; CHECK-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef
1228; CHECK-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) {
1229; CHECK-NEXT:    call void [[FN]](i32 undef)
1230; CHECK-NEXT:    ret void
1231;
1232  call void %fn(i32 %arg)
1233  ret void
1234}
1235
1236; Taken from 50683
1237; {{{
1238
1239@g = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)* @f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] }
1240
1241define internal void @f1(i8*** %a) {
1242; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1243; IS__TUNIT____-LABEL: define {{[^@]+}}@f1
1244; IS__TUNIT____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] {
1245; IS__TUNIT____-NEXT:  entry:
1246; IS__TUNIT____-NEXT:    store i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0), i8*** [[A]], align 8
1247; IS__TUNIT____-NEXT:    ret void
1248;
1249; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1250; IS__CGSCC____-LABEL: define {{[^@]+}}@f1
1251; IS__CGSCC____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] {
1252; IS__CGSCC____-NEXT:  entry:
1253; IS__CGSCC____-NEXT:    store i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0), i8*** [[A]], align 8
1254; IS__CGSCC____-NEXT:    ret void
1255;
1256entry:
1257  %x = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0
1258  store i8** %x , i8*** %a, align 8
1259  ret void
1260}
1261
1262define internal void @f2(i1 (i8*)* %a) {
1263; CHECK-LABEL: define {{[^@]+}}@f2
1264; CHECK-SAME: (i1 (i8*)* [[A:%.*]]) {
1265; CHECK-NEXT:  cont461:
1266; CHECK-NEXT:    [[C1:%.*]] = bitcast i1 (i8*)* [[A]] to i8*
1267; CHECK-NEXT:    call void @f3(i8* [[C1]], i1 (i8*)* nocapture nofree [[A]])
1268; CHECK-NEXT:    ret void
1269;
1270cont461:
1271  %c1 = bitcast i1 (i8*)* %a to i8*
1272  call void @f3(i8* %c1, i1 (i8*)* %a)
1273  ret void
1274}
1275
1276define internal void @f3(i8* %a1, i1 (i8*)* %a) {
1277; CHECK-LABEL: define {{[^@]+}}@f3
1278; CHECK-SAME: (i8* [[A1:%.*]], i1 (i8*)* nocapture nofree [[A:%.*]]) {
1279; CHECK-NEXT:  entry:
1280; CHECK-NEXT:    [[CALL20:%.*]] = call i1 @f9()
1281; CHECK-NEXT:    br i1 [[CALL20]], label [[LAND_LHS_TRUE:%.*]], label [[IF_END40:%.*]]
1282; CHECK:       land.lhs.true:
1283; CHECK-NEXT:    [[TMP0:%.*]] = call i1 [[A]](i8* [[A1]])
1284; CHECK-NEXT:    br label [[IF_END40]]
1285; CHECK:       if.end40:
1286; CHECK-NEXT:    ret void
1287;
1288entry:
1289  %call20 = call i1 @f9()
1290  br i1 %call20, label %land.lhs.true, label %if.end40
1291
1292land.lhs.true:
1293  call i1 %a(i8* %a1)
1294  br label %if.end40
1295
1296if.end40:
1297  ret void
1298}
1299
1300define linkonce_odr i1 @f9() {
1301; CHECK-LABEL: define {{[^@]+}}@f9() {
1302; CHECK-NEXT:  entry:
1303; CHECK-NEXT:    ret i1 false
1304;
1305entry:
1306  ret i1 false
1307}
1308
1309; }}}
1310
1311
1312define i1 @test_cmp_null_after_cast() {
1313; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1314; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmp_null_after_cast
1315; IS__TUNIT____-SAME: () #[[ATTR1]] {
1316; IS__TUNIT____-NEXT:    ret i1 true
1317;
1318; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1319; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_cmp_null_after_cast
1320; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
1321; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i1 @cmp_null_after_cast() #[[ATTR13]]
1322; IS__CGSCC_OPM-NEXT:    ret i1 [[C]]
1323;
1324; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1325; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_cmp_null_after_cast
1326; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
1327; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i1 @cmp_null_after_cast() #[[ATTR12]]
1328; IS__CGSCC_NPM-NEXT:    ret i1 [[C]]
1329;
1330  %c = call i1 @cmp_null_after_cast(i32 0, i8 0)
1331  ret i1 %c
1332}
1333define internal i1 @cmp_null_after_cast(i32 %a, i8 %b) {
1334; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1335; IS__CGSCC____-LABEL: define {{[^@]+}}@cmp_null_after_cast
1336; IS__CGSCC____-SAME: () #[[ATTR1]] {
1337; IS__CGSCC____-NEXT:    ret i1 true
1338;
1339  %t = trunc i32 %a to i8
1340  %c = icmp eq i8 %t, %b
1341  ret i1 %c
1342}
1343
1344
1345declare i8* @m()
1346
1347define i32 @test(i1 %c) {
1348; CHECK-LABEL: define {{[^@]+}}@test
1349; CHECK-SAME: (i1 [[C:%.*]]) {
1350; CHECK-NEXT:    [[R1:%.*]] = call i32 @ctx_test1(i1 [[C]])
1351; CHECK-NEXT:    [[R2:%.*]] = call i32 @ctx_test2(i1 [[C]])
1352; CHECK-NEXT:    [[ADD:%.*]] = add i32 [[R1]], [[R2]]
1353; CHECK-NEXT:    ret i32 [[ADD]]
1354;
1355  %r1 = call i32 @ctx_test1(i1 %c)
1356  %r2 = call i32 @ctx_test2(i1 %c)
1357  %add = add i32 %r1, %r2
1358  ret i32 %add
1359}
1360
1361define internal i32 @ctx_test1(i1 %c) {
1362; CHECK-LABEL: define {{[^@]+}}@ctx_test1
1363; CHECK-SAME: (i1 [[C:%.*]]) {
1364; CHECK-NEXT:  entry:
1365; CHECK-NEXT:    br i1 [[C]], label [[THEN:%.*]], label [[JOIN:%.*]]
1366; CHECK:       then:
1367; CHECK-NEXT:    [[M:%.*]] = tail call i8* @m()
1368; CHECK-NEXT:    [[I:%.*]] = ptrtoint i8* [[M]] to i64
1369; CHECK-NEXT:    br label [[JOIN]]
1370; CHECK:       join:
1371; CHECK-NEXT:    [[PHI:%.*]] = phi i64 [ [[I]], [[THEN]] ], [ undef, [[ENTRY:%.*]] ]
1372; CHECK-NEXT:    [[RET:%.*]] = trunc i64 [[PHI]] to i32
1373; CHECK-NEXT:    ret i32 [[RET]]
1374;
1375entry:
1376  br i1 %c, label %then, label %join
1377
1378then:
1379  %m = tail call i8* @m()
1380  %i = ptrtoint i8* %m to i64
1381  br label %join
1382
1383join:
1384  %phi = phi i64 [ %i, %then ], [ undef, %entry ]
1385  %ret = trunc i64 %phi to i32
1386  ret i32 %ret
1387}
1388
1389define internal i32 @ctx_test2(i1 %c) {
1390; CHECK-LABEL: define {{[^@]+}}@ctx_test2
1391; CHECK-SAME: (i1 [[C:%.*]]) {
1392; CHECK-NEXT:  entry:
1393; CHECK-NEXT:    br i1 [[C]], label [[THEN:%.*]], label [[JOIN:%.*]]
1394; CHECK:       then:
1395; CHECK-NEXT:    [[M:%.*]] = tail call i8* @m()
1396; CHECK-NEXT:    [[I:%.*]] = ptrtoint i8* [[M]] to i32
1397; CHECK-NEXT:    br label [[JOIN]]
1398; CHECK:       join:
1399; CHECK-NEXT:    [[PHI:%.*]] = phi i32 [ [[I]], [[THEN]] ], [ undef, [[ENTRY:%.*]] ]
1400; CHECK-NEXT:    [[RET:%.*]] = lshr i32 [[PHI]], 1
1401; CHECK-NEXT:    ret i32 [[RET]]
1402;
1403entry:
1404  br i1 %c, label %then, label %join
1405
1406then:
1407  %m = tail call i8* @m()
1408  %i = ptrtoint i8* %m to i32
1409  br label %join
1410
1411join:
1412  %phi = phi i32 [ %i, %then ], [ undef, %entry ]
1413  %ret = lshr i32 %phi, 1
1414  ret i32 %ret
1415
1416  uselistorder label %join, { 1, 0 }
1417}
1418
1419define i1 @test_liveness(i1 %c) {
1420; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1421; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_liveness
1422; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1423; IS__TUNIT_OPM-NEXT:  entry:
1424; IS__TUNIT_OPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1425; IS__TUNIT_OPM:       t:
1426; IS__TUNIT_OPM-NEXT:    br label [[F]]
1427; IS__TUNIT_OPM:       f:
1428; IS__TUNIT_OPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1429; IS__TUNIT_OPM-NEXT:    [[RC1:%.*]] = call i1 @ret(i1 noundef [[P]]) #[[ATTR10]]
1430; IS__TUNIT_OPM-NEXT:    ret i1 [[RC1]]
1431;
1432; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1433; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_liveness
1434; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1435; IS__TUNIT_NPM-NEXT:  entry:
1436; IS__TUNIT_NPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1437; IS__TUNIT_NPM:       t:
1438; IS__TUNIT_NPM-NEXT:    br label [[F]]
1439; IS__TUNIT_NPM:       f:
1440; IS__TUNIT_NPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1441; IS__TUNIT_NPM-NEXT:    [[RC1:%.*]] = call i1 @ret(i1 noundef [[P]]) #[[ATTR9]]
1442; IS__TUNIT_NPM-NEXT:    ret i1 [[RC1]]
1443;
1444; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1445; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_liveness
1446; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1447; IS__CGSCC_OPM-NEXT:  entry:
1448; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1449; IS__CGSCC_OPM:       t:
1450; IS__CGSCC_OPM-NEXT:    br label [[F]]
1451; IS__CGSCC_OPM:       f:
1452; IS__CGSCC_OPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1453; IS__CGSCC_OPM-NEXT:    [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR13]]
1454; IS__CGSCC_OPM-NEXT:    ret i1 [[RC1]]
1455;
1456; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1457; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_liveness
1458; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1459; IS__CGSCC_NPM-NEXT:  entry:
1460; IS__CGSCC_NPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1461; IS__CGSCC_NPM:       t:
1462; IS__CGSCC_NPM-NEXT:    br label [[F]]
1463; IS__CGSCC_NPM:       f:
1464; IS__CGSCC_NPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1465; IS__CGSCC_NPM-NEXT:    [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR12]]
1466; IS__CGSCC_NPM-NEXT:    ret i1 [[RC1]]
1467;
1468entry:
1469  br i1 %c, label %t, label %f
1470t:
1471  br label %f
1472f:
1473  %p = phi i1 [true, %entry], [false, %t]
1474  %rc1 = call i1 @ret(i1 %p)
1475  ret i1 %rc1
1476}
1477
1478define internal i1 @ret(i1 %c) {
1479; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1480; CHECK-LABEL: define {{[^@]+}}@ret
1481; CHECK-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] {
1482; CHECK-NEXT:  entry:
1483; CHECK-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1484; CHECK:       t:
1485; CHECK-NEXT:    br label [[F]]
1486; CHECK:       f:
1487; CHECK-NEXT:    [[P:%.*]] = phi i1 [ [[C]], [[ENTRY:%.*]] ], [ false, [[T]] ]
1488; CHECK-NEXT:    ret i1 [[P]]
1489;
1490entry:
1491  br i1 %c, label %t, label %f
1492t:
1493  br label %f
1494f:
1495  %p = phi i1 [%c, %entry], [false, %t]
1496  ret i1 %p
1497}
1498
1499declare i8* @unknown()
1500define internal i8 @dead_ret() {
1501; CHECK-LABEL: define {{[^@]+}}@dead_ret() {
1502; CHECK-NEXT:    [[R:%.*]] = call i8* @unknown()
1503; CHECK-NEXT:    ret i8 undef
1504;
1505  %r = call i8* @unknown()
1506  %l = load i8, i8* %r
1507  ret i8 %l
1508}
1509
1510define void @dead_ret_caller() {
1511; CHECK-LABEL: define {{[^@]+}}@dead_ret_caller() {
1512; CHECK-NEXT:    [[R:%.*]] = call i8 @dead_ret()
1513; CHECK-NEXT:    ret void
1514;
1515  %r = call i8 @dead_ret()
1516  ret void
1517}
1518
1519declare void @llvm.memcpy(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
1520define internal i8 @memcpy_uses_store(i8 %arg) {
1521; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1522; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1523; IS__TUNIT_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] {
1524; IS__TUNIT_OPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1525; IS__TUNIT_OPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1526; IS__TUNIT_OPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1527; IS__TUNIT_OPM-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR11]]
1528; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1529; IS__TUNIT_OPM-NEXT:    ret i8 [[L]]
1530;
1531; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1532; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1533; IS__TUNIT_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] {
1534; IS__TUNIT_NPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1535; IS__TUNIT_NPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1536; IS__TUNIT_NPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1537; IS__TUNIT_NPM-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR10]]
1538; IS__TUNIT_NPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1539; IS__TUNIT_NPM-NEXT:    ret i8 [[L]]
1540;
1541; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1542; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1543; IS__CGSCC_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR8:[0-9]+]] {
1544; IS__CGSCC_OPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1545; IS__CGSCC_OPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1546; IS__CGSCC_OPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1547; IS__CGSCC_OPM-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR14]]
1548; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1549; IS__CGSCC_OPM-NEXT:    ret i8 [[L]]
1550;
1551; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1552; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1553; IS__CGSCC_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR7:[0-9]+]] {
1554; IS__CGSCC_NPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1555; IS__CGSCC_NPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1556; IS__CGSCC_NPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1557; IS__CGSCC_NPM-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i32(i8* noalias nocapture nofree noundef nonnull writeonly dereferenceable(1) [[DST]], i8* noalias nocapture nofree noundef nonnull readonly dereferenceable(1) [[SRC]], i32 noundef 1, i1 noundef false) #[[ATTR13]]
1558; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1559; IS__CGSCC_NPM-NEXT:    ret i8 [[L]]
1560;
1561  %src = alloca i8
1562  %dst = alloca i8
1563  store i8 %arg, i8* %src
1564  call void @llvm.memcpy(i8* %dst, i8* %src, i32 1, i1 false)
1565  %l = load i8, i8* %dst
1566  ret i8 %l
1567}
1568
1569define i8 @memcpy_uses_store_caller(i8 %arg) {
1570; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1571; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1572; IS__TUNIT_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] {
1573; IS__TUNIT_OPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR13:[0-9]+]]
1574; IS__TUNIT_OPM-NEXT:    ret i8 [[R]]
1575;
1576; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
1577; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1578; IS__TUNIT_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR2]] {
1579; IS__TUNIT_NPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR12:[0-9]+]]
1580; IS__TUNIT_NPM-NEXT:    ret i8 [[R]]
1581;
1582; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
1583; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1584; IS__CGSCC_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] {
1585; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR16:[0-9]+]]
1586; IS__CGSCC_OPM-NEXT:    ret i8 [[R]]
1587;
1588; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
1589; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1590; IS__CGSCC_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] {
1591; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR15:[0-9]+]]
1592; IS__CGSCC_NPM-NEXT:    ret i8 [[R]]
1593;
1594  %r = call i8 @memcpy_uses_store(i8 %arg)
1595  ret i8 %r
1596}
1597
1598
1599declare i32 @speculatable() speculatable readnone
1600
1601define i32 @test_speculatable_expr() norecurse {
1602; IS__TUNIT_OPM: Function Attrs: norecurse nosync readnone
1603; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1604; IS__TUNIT_OPM-SAME: () #[[ATTR7:[0-9]+]] {
1605; IS__TUNIT_OPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1606; IS__TUNIT_OPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1607; IS__TUNIT_OPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1608; IS__TUNIT_OPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1609; IS__TUNIT_OPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[STACK]]) #[[ATTR14:[0-9]+]]
1610; IS__TUNIT_OPM-NEXT:    ret i32 [[RSPEC]]
1611;
1612; IS__TUNIT_NPM: Function Attrs: norecurse nosync readnone
1613; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1614; IS__TUNIT_NPM-SAME: () #[[ATTR6:[0-9]+]] {
1615; IS__TUNIT_NPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1616; IS__TUNIT_NPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1617; IS__TUNIT_NPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1618; IS__TUNIT_NPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1619; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[STACK]], align 4
1620; IS__TUNIT_NPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32 [[TMP1]]) #[[ATTR13:[0-9]+]]
1621; IS__TUNIT_NPM-NEXT:    ret i32 [[RSPEC]]
1622;
1623; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone
1624; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1625; IS__CGSCC_OPM-SAME: () #[[ATTR10:[0-9]+]] {
1626; IS__CGSCC_OPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1627; IS__CGSCC_OPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1628; IS__CGSCC_OPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1629; IS__CGSCC_OPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1630; IS__CGSCC_OPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[STACK]]) #[[ATTR17:[0-9]+]]
1631; IS__CGSCC_OPM-NEXT:    ret i32 [[RSPEC]]
1632;
1633; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone
1634; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1635; IS__CGSCC_NPM-SAME: () #[[ATTR9:[0-9]+]] {
1636; IS__CGSCC_NPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1637; IS__CGSCC_NPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1638; IS__CGSCC_NPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1639; IS__CGSCC_NPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1640; IS__CGSCC_NPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32 [[PLUS1]])
1641; IS__CGSCC_NPM-NEXT:    ret i32 [[RSPEC]]
1642;
1643  %stack = alloca i32
1644  %spec_result = call i32 @speculatable()
1645  %plus1 = add i32 %spec_result, 1
1646  store i32 %plus1, i32* %stack
1647  %rspec = call i32 @ret_speculatable_expr(i32* %stack, i32 13)
1648  ret i32 %rspec
1649}
1650
1651define internal i32 @ret_speculatable_expr(i32* %mem, i32 %a2) {
1652; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1653; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1654; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[MEM:%.*]]) #[[ATTR8:[0-9]+]] {
1655; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i32, i32* [[MEM]], align 4
1656; IS__TUNIT_OPM-NEXT:    [[MUL:%.*]] = mul i32 [[L]], 13
1657; IS__TUNIT_OPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1658; IS__TUNIT_OPM-NEXT:    ret i32 [[ADD]]
1659;
1660; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1661; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1662; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR7:[0-9]+]] {
1663; IS__TUNIT_NPM-NEXT:    [[MEM_PRIV:%.*]] = alloca i32, align 4
1664; IS__TUNIT_NPM-NEXT:    store i32 [[TMP0]], i32* [[MEM_PRIV]], align 4
1665; IS__TUNIT_NPM-NEXT:    [[L:%.*]] = load i32, i32* [[MEM_PRIV]], align 4
1666; IS__TUNIT_NPM-NEXT:    [[MUL:%.*]] = mul i32 [[L]], 13
1667; IS__TUNIT_NPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1668; IS__TUNIT_NPM-NEXT:    ret i32 [[ADD]]
1669;
1670; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1671; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1672; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[MEM:%.*]]) #[[ATTR11:[0-9]+]] {
1673; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = load i32, i32* [[MEM]], align 4
1674; IS__CGSCC_OPM-NEXT:    [[MUL:%.*]] = mul i32 [[L]], 13
1675; IS__CGSCC_OPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1676; IS__CGSCC_OPM-NEXT:    ret i32 [[ADD]]
1677;
1678; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1679; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1680; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR10:[0-9]+]] {
1681; IS__CGSCC_NPM-NEXT:    [[MEM_PRIV:%.*]] = alloca i32, align 4
1682; IS__CGSCC_NPM-NEXT:    store i32 [[TMP0]], i32* [[MEM_PRIV]], align 4
1683; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = load i32, i32* [[MEM_PRIV]], align 4
1684; IS__CGSCC_NPM-NEXT:    [[MUL:%.*]] = mul i32 [[L]], 13
1685; IS__CGSCC_NPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1686; IS__CGSCC_NPM-NEXT:    ret i32 [[ADD]]
1687;
1688  %l = load i32, i32* %mem
1689  %mul = mul i32 %l, %a2
1690  %add = add i32 %mul, 7
1691  ret i32 %add
1692}
1693
1694
1695;.
1696; IS__TUNIT_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1697; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1698; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn }
1699; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1700; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
1701; IS__TUNIT_OPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind writeonly }
1702; IS__TUNIT_OPM: attributes #[[ATTR6:[0-9]+]] = { readnone speculatable }
1703; IS__TUNIT_OPM: attributes #[[ATTR7]] = { norecurse nosync readnone }
1704; IS__TUNIT_OPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1705; IS__TUNIT_OPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
1706; IS__TUNIT_OPM: attributes #[[ATTR10]] = { nofree nosync nounwind readnone willreturn }
1707; IS__TUNIT_OPM: attributes #[[ATTR11]] = { willreturn }
1708; IS__TUNIT_OPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly }
1709; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn }
1710; IS__TUNIT_OPM: attributes #[[ATTR14]] = { nosync nounwind readonly }
1711;.
1712; IS__TUNIT_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1713; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1714; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn }
1715; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1716; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
1717; IS__TUNIT_NPM: attributes #[[ATTR5:[0-9]+]] = { readnone speculatable }
1718; IS__TUNIT_NPM: attributes #[[ATTR6]] = { norecurse nosync readnone }
1719; IS__TUNIT_NPM: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1720; IS__TUNIT_NPM: attributes #[[ATTR8:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
1721; IS__TUNIT_NPM: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn }
1722; IS__TUNIT_NPM: attributes #[[ATTR10]] = { willreturn }
1723; IS__TUNIT_NPM: attributes #[[ATTR11]] = { nofree nosync nounwind willreturn writeonly }
1724; IS__TUNIT_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn }
1725; IS__TUNIT_NPM: attributes #[[ATTR13]] = { nosync nounwind readonly }
1726;.
1727; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1728; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1729; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn }
1730; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
1731; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1732; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly }
1733; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind writeonly }
1734; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly }
1735; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nofree norecurse nosync nounwind willreturn }
1736; IS__CGSCC_OPM: attributes #[[ATTR9:[0-9]+]] = { readnone speculatable }
1737; IS__CGSCC_OPM: attributes #[[ATTR10]] = { norecurse nosync readnone }
1738; IS__CGSCC_OPM: attributes #[[ATTR11]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1739; IS__CGSCC_OPM: attributes #[[ATTR12:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
1740; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readnone willreturn }
1741; IS__CGSCC_OPM: attributes #[[ATTR14]] = { willreturn }
1742; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nounwind willreturn writeonly }
1743; IS__CGSCC_OPM: attributes #[[ATTR16]] = { nounwind willreturn }
1744; IS__CGSCC_OPM: attributes #[[ATTR17]] = { readonly }
1745;.
1746; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1747; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1748; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn }
1749; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
1750; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1751; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly }
1752; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly }
1753; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nofree norecurse nosync nounwind willreturn }
1754; IS__CGSCC_NPM: attributes #[[ATTR8:[0-9]+]] = { readnone speculatable }
1755; IS__CGSCC_NPM: attributes #[[ATTR9]] = { norecurse nosync readnone }
1756; IS__CGSCC_NPM: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1757; IS__CGSCC_NPM: attributes #[[ATTR11:[0-9]+]] = { argmemonly nocallback nofree nounwind willreturn }
1758; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readnone willreturn }
1759; IS__CGSCC_NPM: attributes #[[ATTR13]] = { willreturn }
1760; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn writeonly }
1761; IS__CGSCC_NPM: attributes #[[ATTR15]] = { nounwind willreturn }
1762;.
1763