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=16 -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=16 -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() #[[ATTR12:[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() #[[ATTR12]]
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() #[[ATTR11:[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() #[[ATTR11]]
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]]) #[[ATTR12]]
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]]) #[[ATTR11]]
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() #[[ATTR12]]
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() #[[ATTR11]]
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() #[[ATTR12]]
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() #[[ATTR11]]
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() #[[ATTR12]]
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() #[[ATTR11]]
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() #[[ATTR12]]
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() #[[ATTR11]]
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) #[[ATTR12]]
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) #[[ATTR11]]
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() #[[ATTR12]]
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() #[[ATTR11]]
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]]) #[[ATTR11:[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]]) #[[ATTR10:[0-9]+]]
512; IS__TUNIT_NPM-NEXT:    ret i32* [[CALL]]
513;
514; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
515; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_inalloca
516; IS__CGSCC____-SAME: (i32* nofree noundef nonnull readnone returned dereferenceable(4) [[ARG:%.*]]) #[[ATTR2:[0-9]+]] {
517; IS__CGSCC____-NEXT:    ret i32* [[ARG]]
518;
519  %call = call i32* @test_inalloca(i32* inalloca(i32) %arg)
520  ret i32* %call
521}
522
523define internal i32* @test_preallocated(i32* preallocated(i32) %a) {
524; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
525; CHECK-LABEL: define {{[^@]+}}@test_preallocated
526; CHECK-SAME: (i32* noalias nofree noundef nonnull returned writeonly preallocated(i32) align 4294967296 dereferenceable(4) "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
527; CHECK-NEXT:    ret i32* [[A]]
528;
529  ret i32* %a
530}
531define i32* @complicated_args_preallocated() {
532; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn
533; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
534; IS__TUNIT_OPM-SAME: () #[[ATTR2:[0-9]+]] {
535; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR12:[0-9]+]]
536; 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) #[[ATTR11]] [ "preallocated"(token [[C]]) ]
537; IS__TUNIT_OPM-NEXT:    ret i32* [[CALL]]
538;
539; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn
540; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
541; IS__TUNIT_NPM-SAME: () #[[ATTR2:[0-9]+]] {
542; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR11:[0-9]+]]
543; 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) #[[ATTR10]] [ "preallocated"(token [[C]]) ]
544; IS__TUNIT_NPM-NEXT:    ret i32* [[CALL]]
545;
546; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
547; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
548; IS__CGSCC_OPM-SAME: () #[[ATTR3:[0-9]+]] {
549; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR13:[0-9]+]]
550; IS__CGSCC_OPM-NEXT:    ret i32* null
551;
552; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
553; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_preallocated
554; IS__CGSCC_NPM-SAME: () #[[ATTR3:[0-9]+]] {
555; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call token @llvm.call.preallocated.setup(i32 noundef 1) #[[ATTR12:[0-9]+]]
556; IS__CGSCC_NPM-NEXT:    ret i32* null
557;
558  %c = call token @llvm.call.preallocated.setup(i32 1)
559  %call = call i32* @test_preallocated(i32* preallocated(i32) null) ["preallocated"(token %c)]
560  ret i32* %call
561}
562
563define internal void @test_sret(%struct.X* sret(%struct.X) %a, %struct.X** %b) {
564;
565; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
566; IS__TUNIT____-LABEL: define {{[^@]+}}@test_sret
567; 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]+]] {
568; IS__TUNIT____-NEXT:    store %struct.X* [[A]], %struct.X** [[B]], align 8
569; IS__TUNIT____-NEXT:    ret void
570;
571; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
572; IS__CGSCC____-LABEL: define {{[^@]+}}@test_sret
573; 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]+]] {
574; IS__CGSCC____-NEXT:    store %struct.X* [[A]], %struct.X** [[B]], align 8
575; IS__CGSCC____-NEXT:    ret void
576;
577  store %struct.X* %a, %struct.X** %b
578  ret void
579}
580; FIXME: Alignment and dereferenceability are not propagated to the argument
581define void @complicated_args_sret(%struct.X** %b) {
582;
583;
584; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
585; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_sret
586; IS__TUNIT_OPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] {
587; 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]]) #[[ATTR13:[0-9]+]]
588; IS__TUNIT_OPM-NEXT:    ret void
589;
590; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
591; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_sret
592; IS__TUNIT_NPM-SAME: (%struct.X** nocapture nofree writeonly [[B:%.*]]) #[[ATTR3]] {
593; 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]]) #[[ATTR12:[0-9]+]]
594; IS__TUNIT_NPM-NEXT:    ret void
595;
596; IS__CGSCC____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
597; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_sret
598; IS__CGSCC____-SAME: (%struct.X** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[B:%.*]]) #[[ATTR5:[0-9]+]] {
599; IS__CGSCC____-NEXT:    unreachable
600;
601  call void @test_sret(%struct.X* sret(%struct.X) null, %struct.X** %b)
602  ret void
603}
604
605define internal %struct.X* @test_nest(%struct.X* nest %a) {
606; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
607; IS__CGSCC____-LABEL: define {{[^@]+}}@test_nest
608; IS__CGSCC____-SAME: (%struct.X* nest noalias nofree noundef readnone returned align 4294967296 "no-capture-maybe-returned" [[A:%.*]]) #[[ATTR1]] {
609; IS__CGSCC____-NEXT:    ret %struct.X* [[A]]
610;
611  ret %struct.X* %a
612}
613define %struct.X* @complicated_args_nest() {
614; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
615; IS__TUNIT____-LABEL: define {{[^@]+}}@complicated_args_nest
616; IS__TUNIT____-SAME: () #[[ATTR1]] {
617; IS__TUNIT____-NEXT:    ret %struct.X* null
618;
619; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
620; IS__CGSCC____-LABEL: define {{[^@]+}}@complicated_args_nest
621; IS__CGSCC____-SAME: () #[[ATTR2]] {
622; IS__CGSCC____-NEXT:    ret %struct.X* null
623;
624  %call = call %struct.X* @test_nest(%struct.X* null)
625  ret %struct.X* %call
626}
627
628@S = external global %struct.X
629define internal void @test_byval(%struct.X* byval(%struct.X) %a) {
630; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
631; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_byval
632; IS__TUNIT_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] {
633; IS__TUNIT_OPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0
634; IS__TUNIT_OPM-NEXT:    store i8* null, i8** [[G0]], align 8
635; IS__TUNIT_OPM-NEXT:    ret void
636;
637; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
638; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_byval
639; IS__TUNIT_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR3]] {
640; IS__TUNIT_NPM-NEXT:    [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8
641; IS__TUNIT_NPM-NEXT:    [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8**
642; IS__TUNIT_NPM-NEXT:    store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8
643; IS__TUNIT_NPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0
644; IS__TUNIT_NPM-NEXT:    store i8* null, i8** [[G0]], align 8
645; IS__TUNIT_NPM-NEXT:    ret void
646;
647; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
648; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_byval
649; IS__CGSCC_OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull writeonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] {
650; IS__CGSCC_OPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0
651; IS__CGSCC_OPM-NEXT:    store i8* null, i8** [[G0]], align 8
652; IS__CGSCC_OPM-NEXT:    ret void
653;
654; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
655; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_byval
656; IS__CGSCC_NPM-SAME: (i8* [[TMP0:%.*]]) #[[ATTR4]] {
657; IS__CGSCC_NPM-NEXT:    [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8
658; IS__CGSCC_NPM-NEXT:    [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8**
659; IS__CGSCC_NPM-NEXT:    store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8
660; IS__CGSCC_NPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0
661; IS__CGSCC_NPM-NEXT:    store i8* null, i8** [[G0]], align 8
662; IS__CGSCC_NPM-NEXT:    ret void
663;
664  %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0
665  store i8* null, i8** %g0
666  ret void
667}
668define void @complicated_args_byval() {
669; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
670; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval
671; IS__TUNIT_OPM-SAME: () #[[ATTR4:[0-9]+]] {
672; IS__TUNIT_OPM-NEXT:    call void @test_byval(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR13]]
673; IS__TUNIT_OPM-NEXT:    ret void
674;
675; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
676; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval
677; IS__TUNIT_NPM-SAME: () #[[ATTR4:[0-9]+]] {
678; IS__TUNIT_NPM-NEXT:    [[S_CAST:%.*]] = bitcast %struct.X* @S to i8**
679; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8
680; IS__TUNIT_NPM-NEXT:    call void @test_byval(i8* [[TMP1]]) #[[ATTR12]]
681; IS__TUNIT_NPM-NEXT:    ret void
682;
683; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
684; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval
685; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
686; IS__CGSCC_OPM-NEXT:    call void @test_byval(%struct.X* noalias nocapture nofree noundef nonnull readnone byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S) #[[ATTR14:[0-9]+]]
687; IS__CGSCC_OPM-NEXT:    ret void
688;
689; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
690; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval
691; IS__CGSCC_NPM-SAME: () #[[ATTR3]] {
692; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8
693; IS__CGSCC_NPM-NEXT:    call void @test_byval(i8* nofree writeonly [[TMP1]]) #[[ATTR13:[0-9]+]]
694; IS__CGSCC_NPM-NEXT:    ret void
695;
696  call void @test_byval(%struct.X* byval(%struct.X) @S)
697  ret void
698}
699
700declare void @sync()
701; Make sure we *do not* load @S here!
702define internal i8*@test_byval2(%struct.X* byval(%struct.X) %a) {
703; IS________OPM-LABEL: define {{[^@]+}}@test_byval2
704; IS________OPM-SAME: (%struct.X* noalias nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) [[A:%.*]]) {
705; IS________OPM-NEXT:    call void @sync()
706; IS________OPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A]], i32 0, i32 0
707; IS________OPM-NEXT:    [[L:%.*]] = load i8*, i8** [[G0]], align 8
708; IS________OPM-NEXT:    ret i8* [[L]]
709;
710; IS________NPM-LABEL: define {{[^@]+}}@test_byval2
711; IS________NPM-SAME: (i8* [[TMP0:%.*]]) {
712; IS________NPM-NEXT:    [[A_PRIV:%.*]] = alloca [[STRUCT_X:%.*]], align 8
713; IS________NPM-NEXT:    [[A_PRIV_CAST:%.*]] = bitcast %struct.X* [[A_PRIV]] to i8**
714; IS________NPM-NEXT:    store i8* [[TMP0]], i8** [[A_PRIV_CAST]], align 8
715; IS________NPM-NEXT:    call void @sync()
716; IS________NPM-NEXT:    [[G0:%.*]] = getelementptr [[STRUCT_X]], %struct.X* [[A_PRIV]], i32 0, i32 0
717; IS________NPM-NEXT:    [[L:%.*]] = load i8*, i8** [[G0]], align 8
718; IS________NPM-NEXT:    ret i8* [[L]]
719;
720  call void @sync()
721  %g0 = getelementptr %struct.X, %struct.X* %a, i32 0, i32 0
722  %l = load i8*, i8** %g0
723  ret i8* %l
724}
725define i8* @complicated_args_byval2() {
726;
727; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
728; IS__TUNIT_OPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(%struct.X* nocapture nofree noundef nonnull readonly byval([[STRUCT_X:%.*]]) align 8 dereferenceable(8) @S)
729; IS__TUNIT_OPM-NEXT:    ret i8* [[C]]
730;
731; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
732; IS__TUNIT_NPM-NEXT:    [[S_CAST:%.*]] = bitcast %struct.X* @S to i8**
733; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** [[S_CAST]], align 8
734; IS__TUNIT_NPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]])
735; IS__TUNIT_NPM-NEXT:    ret i8* [[C]]
736;
737; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
738; 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)
739; IS__CGSCC_OPM-NEXT:    ret i8* [[C]]
740;
741; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@complicated_args_byval2() {
742; IS__CGSCC_NPM-NEXT:    [[TMP1:%.*]] = load i8*, i8** getelementptr inbounds ([[STRUCT_X:%.*]], %struct.X* @S, i32 0, i32 0), align 8
743; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call i8* @test_byval2(i8* [[TMP1]])
744; IS__CGSCC_NPM-NEXT:    ret i8* [[C]]
745;
746  %c = call i8* @test_byval2(%struct.X* byval(%struct.X) @S)
747  ret i8* %c
748}
749
750define void @fixpoint_changed(i32* %p) {
751; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly
752; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@fixpoint_changed
753; IS__TUNIT_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR5:[0-9]+]] {
754; IS__TUNIT_OPM-NEXT:  entry:
755; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND:%.*]]
756; IS__TUNIT_OPM:       for.cond:
757; IS__TUNIT_OPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
758; IS__TUNIT_OPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
759; IS__TUNIT_OPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
760; IS__TUNIT_OPM:       for.body:
761; IS__TUNIT_OPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
762; IS__TUNIT_OPM-NEXT:    i32 1, label [[SW_BB:%.*]]
763; IS__TUNIT_OPM-NEXT:    ]
764; IS__TUNIT_OPM:       sw.bb:
765; IS__TUNIT_OPM-NEXT:    br label [[SW_EPILOG]]
766; IS__TUNIT_OPM:       sw.epilog:
767; IS__TUNIT_OPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
768; IS__TUNIT_OPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
769; IS__TUNIT_OPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
770; IS__TUNIT_OPM-NEXT:    br label [[FOR_COND]]
771; IS__TUNIT_OPM:       for.end:
772; IS__TUNIT_OPM-NEXT:    ret void
773;
774; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
775; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@fixpoint_changed
776; IS__TUNIT_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR3]] {
777; IS__TUNIT_NPM-NEXT:  entry:
778; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND:%.*]]
779; IS__TUNIT_NPM:       for.cond:
780; IS__TUNIT_NPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
781; IS__TUNIT_NPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
782; IS__TUNIT_NPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
783; IS__TUNIT_NPM:       for.body:
784; IS__TUNIT_NPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
785; IS__TUNIT_NPM-NEXT:    i32 1, label [[SW_BB:%.*]]
786; IS__TUNIT_NPM-NEXT:    ]
787; IS__TUNIT_NPM:       sw.bb:
788; IS__TUNIT_NPM-NEXT:    br label [[SW_EPILOG]]
789; IS__TUNIT_NPM:       sw.epilog:
790; IS__TUNIT_NPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
791; IS__TUNIT_NPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
792; IS__TUNIT_NPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
793; IS__TUNIT_NPM-NEXT:    br label [[FOR_COND]]
794; IS__TUNIT_NPM:       for.end:
795; IS__TUNIT_NPM-NEXT:    ret void
796;
797; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind writeonly
798; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@fixpoint_changed
799; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR6:[0-9]+]] {
800; IS__CGSCC_OPM-NEXT:  entry:
801; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND:%.*]]
802; IS__CGSCC_OPM:       for.cond:
803; IS__CGSCC_OPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
804; IS__CGSCC_OPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
805; IS__CGSCC_OPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
806; IS__CGSCC_OPM:       for.body:
807; IS__CGSCC_OPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
808; IS__CGSCC_OPM-NEXT:    i32 1, label [[SW_BB:%.*]]
809; IS__CGSCC_OPM-NEXT:    ]
810; IS__CGSCC_OPM:       sw.bb:
811; IS__CGSCC_OPM-NEXT:    br label [[SW_EPILOG]]
812; IS__CGSCC_OPM:       sw.epilog:
813; IS__CGSCC_OPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
814; IS__CGSCC_OPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
815; IS__CGSCC_OPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
816; IS__CGSCC_OPM-NEXT:    br label [[FOR_COND]]
817; IS__CGSCC_OPM:       for.end:
818; IS__CGSCC_OPM-NEXT:    ret void
819;
820; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
821; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@fixpoint_changed
822; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly [[P:%.*]]) #[[ATTR4]] {
823; IS__CGSCC_NPM-NEXT:  entry:
824; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND:%.*]]
825; IS__CGSCC_NPM:       for.cond:
826; IS__CGSCC_NPM-NEXT:    [[J_0:%.*]] = phi i32 [ 0, [[ENTRY:%.*]] ], [ [[INC:%.*]], [[SW_EPILOG:%.*]] ]
827; IS__CGSCC_NPM-NEXT:    [[CMP:%.*]] = icmp slt i32 [[J_0]], 30
828; IS__CGSCC_NPM-NEXT:    br i1 [[CMP]], label [[FOR_BODY:%.*]], label [[FOR_END:%.*]]
829; IS__CGSCC_NPM:       for.body:
830; IS__CGSCC_NPM-NEXT:    switch i32 [[J_0]], label [[SW_EPILOG]] [
831; IS__CGSCC_NPM-NEXT:    i32 1, label [[SW_BB:%.*]]
832; IS__CGSCC_NPM-NEXT:    ]
833; IS__CGSCC_NPM:       sw.bb:
834; IS__CGSCC_NPM-NEXT:    br label [[SW_EPILOG]]
835; IS__CGSCC_NPM:       sw.epilog:
836; IS__CGSCC_NPM-NEXT:    [[X_0:%.*]] = phi i32 [ 255, [[FOR_BODY]] ], [ 253, [[SW_BB]] ]
837; IS__CGSCC_NPM-NEXT:    store i32 [[X_0]], i32* [[P]], align 4
838; IS__CGSCC_NPM-NEXT:    [[INC]] = add nsw i32 [[J_0]], 1
839; IS__CGSCC_NPM-NEXT:    br label [[FOR_COND]]
840; IS__CGSCC_NPM:       for.end:
841; IS__CGSCC_NPM-NEXT:    ret void
842;
843entry:
844  br label %for.cond
845
846for.cond:
847  %j.0 = phi i32 [ 0, %entry ], [ %inc, %sw.epilog ]
848  %cmp = icmp slt i32 %j.0, 30
849  br i1 %cmp, label %for.body, label %for.end
850
851for.body:
852  switch i32 %j.0, label %sw.epilog [
853  i32 1, label %sw.bb
854  ]
855
856sw.bb:
857  br label %sw.epilog
858
859sw.epilog:
860  %x.0 = phi i32 [ 255, %for.body ], [ 253, %sw.bb ]
861  store i32 %x.0, i32* %p
862  %inc = add nsw i32 %j.0, 1
863  br label %for.cond
864
865for.end:
866  ret void
867}
868
869; Check we merge undef and a constant properly.
870define i8 @caller0() {
871; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
872; IS__TUNIT____-LABEL: define {{[^@]+}}@caller0
873; IS__TUNIT____-SAME: () #[[ATTR1]] {
874; IS__TUNIT____-NEXT:    ret i8 49
875;
876; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
877; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller0
878; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
879; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
880; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
881;
882; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
883; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller0
884; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
885; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR11]]
886; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
887;
888  %c = call i8 @callee(i8 undef)
889  ret i8 %c
890}
891define i8 @caller1() {
892; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
893; IS__TUNIT____-LABEL: define {{[^@]+}}@caller1
894; IS__TUNIT____-SAME: () #[[ATTR1]] {
895; IS__TUNIT____-NEXT:    ret i8 49
896;
897; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
898; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller1
899; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
900; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
901; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
902;
903; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
904; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller1
905; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
906; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR11]]
907; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
908;
909  %c = call i8 @callee(i8 undef)
910  ret i8 %c
911}
912define i8 @caller2() {
913; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
914; IS__TUNIT____-LABEL: define {{[^@]+}}@caller2
915; IS__TUNIT____-SAME: () #[[ATTR1]] {
916; IS__TUNIT____-NEXT:    ret i8 49
917;
918; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
919; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller2
920; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
921; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
922; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
923;
924; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
925; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller2
926; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
927; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR11]]
928; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
929;
930  %c = call i8 @callee(i8 undef)
931  ret i8 %c
932}
933define i8 @caller_middle() {
934; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
935; IS__TUNIT____-LABEL: define {{[^@]+}}@caller_middle
936; IS__TUNIT____-SAME: () #[[ATTR1]] {
937; IS__TUNIT____-NEXT:    ret i8 49
938;
939; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
940; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller_middle
941; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
942; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
943; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
944;
945; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
946; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller_middle
947; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
948; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR11]]
949; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
950;
951  %c = call i8 @callee(i8 42)
952  ret i8 %c
953}
954define i8 @caller3() {
955; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
956; IS__TUNIT____-LABEL: define {{[^@]+}}@caller3
957; IS__TUNIT____-SAME: () #[[ATTR1]] {
958; IS__TUNIT____-NEXT:    ret i8 49
959;
960; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
961; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller3
962; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
963; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
964; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
965;
966; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
967; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller3
968; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
969; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR11]]
970; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
971;
972  %c = call i8 @callee(i8 undef)
973  ret i8 %c
974}
975define i8 @caller4() {
976; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
977; IS__TUNIT____-LABEL: define {{[^@]+}}@caller4
978; IS__TUNIT____-SAME: () #[[ATTR1]] {
979; IS__TUNIT____-NEXT:    ret i8 49
980;
981; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
982; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@caller4
983; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
984; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR12]]
985; IS__CGSCC_OPM-NEXT:    ret i8 [[C]]
986;
987; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
988; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@caller4
989; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
990; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i8 @callee() #[[ATTR11]]
991; IS__CGSCC_NPM-NEXT:    ret i8 [[C]]
992;
993  %c = call i8 @callee(i8 undef)
994  ret i8 %c
995}
996define internal i8 @callee(i8 %a) {
997; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
998; IS__CGSCC____-LABEL: define {{[^@]+}}@callee
999; IS__CGSCC____-SAME: () #[[ATTR1]] {
1000; IS__CGSCC____-NEXT:    ret i8 49
1001;
1002  %c = add i8 %a, 7
1003  ret i8 %c
1004}
1005
1006define void @user_as3() {
1007; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1008; IS__TUNIT____-LABEL: define {{[^@]+}}@user_as3
1009; IS__TUNIT____-SAME: () #[[ATTR4:[0-9]+]] {
1010; IS__TUNIT____-NEXT:    store i32 0, i32 addrspace(3)* @ConstAS3Ptr, align 4
1011; IS__TUNIT____-NEXT:    ret void
1012;
1013; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1014; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user_as3
1015; IS__CGSCC_OPM-SAME: () #[[ATTR7:[0-9]+]] {
1016; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32 addrspace(3)* @const_ptr_return_as3() #[[ATTR12]]
1017; IS__CGSCC_OPM-NEXT:    store i32 0, i32 addrspace(3)* [[CALL]], align 4
1018; IS__CGSCC_OPM-NEXT:    ret void
1019;
1020; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1021; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user_as3
1022; IS__CGSCC_NPM-SAME: () #[[ATTR6:[0-9]+]] {
1023; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32 addrspace(3)* @const_ptr_return_as3() #[[ATTR11]]
1024; IS__CGSCC_NPM-NEXT:    store i32 0, i32 addrspace(3)* [[CALL]], align 4
1025; IS__CGSCC_NPM-NEXT:    ret void
1026;
1027  %call = call fastcc i32 addrspace(3)* @const_ptr_return_as3()
1028  store i32 0, i32 addrspace(3)* %call
1029  ret void
1030}
1031define void @user() {
1032; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1033; IS__TUNIT____-LABEL: define {{[^@]+}}@user
1034; IS__TUNIT____-SAME: () #[[ATTR4]] {
1035; IS__TUNIT____-NEXT:    store i32 0, i32* addrspacecast (i32 addrspace(3)* @ConstAS3Ptr to i32*), align 4
1036; IS__TUNIT____-NEXT:    ret void
1037;
1038; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1039; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@user
1040; IS__CGSCC_OPM-SAME: () #[[ATTR7]] {
1041; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32* @const_ptr_return() #[[ATTR12]]
1042; IS__CGSCC_OPM-NEXT:    store i32 0, i32* [[CALL]], align 4
1043; IS__CGSCC_OPM-NEXT:    ret void
1044;
1045; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn writeonly
1046; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@user
1047; IS__CGSCC_NPM-SAME: () #[[ATTR6]] {
1048; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call fastcc align 4 i32* @const_ptr_return() #[[ATTR11]]
1049; IS__CGSCC_NPM-NEXT:    store i32 0, i32* [[CALL]], align 4
1050; IS__CGSCC_NPM-NEXT:    ret void
1051;
1052  %call = call fastcc i32* @const_ptr_return()
1053  store i32 0, i32* %call
1054  ret void
1055}
1056
1057
1058define i1 @test_merge_with_undef_values_ptr(i1 %c) {
1059; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1060; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
1061; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1062; IS__TUNIT____-NEXT:    ret i1 false
1063;
1064; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1065; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
1066; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1067; IS__CGSCC_OPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR12]]
1068; IS__CGSCC_OPM-NEXT:    ret i1 [[R1]]
1069;
1070; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1071; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values_ptr
1072; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1073; IS__CGSCC_NPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_null(i1 [[C]]) #[[ATTR11]]
1074; IS__CGSCC_NPM-NEXT:    ret i1 [[R1]]
1075;
1076  %r1 = call i1 @undef_then_null(i1 %c, i32* undef, i32* undef)
1077  ret i1 %r1
1078}
1079define internal i1 @undef_then_null(i1 %c, i32* %i32Aptr, i32* %i32Bptr) {
1080; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
1081; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_null
1082; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1083; IS__CGSCC____-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
1084; IS__CGSCC____:       a:
1085; IS__CGSCC____-NEXT:    ret i1 false
1086; IS__CGSCC____:       b:
1087; IS__CGSCC____-NEXT:    ret i1 false
1088;
1089  %cmp1 = icmp eq i32* %i32Aptr, %i32Bptr
1090  %cmp2 = icmp eq i1 %cmp1, false
1091  %or = or i1 %cmp2, %c
1092  br i1 %or, label %a, label %b
1093a:
1094  %r2 = call i1 @undef_then_null(i1 false, i32* null, i32* null)
1095  ret i1 %r2
1096b:
1097  ret i1 %cmp2
1098}
1099
1100define i1 @test_merge_with_undef_values(i1 %c) {
1101; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1102; IS__TUNIT____-LABEL: define {{[^@]+}}@test_merge_with_undef_values
1103; IS__TUNIT____-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1104; IS__TUNIT____-NEXT:    ret i1 false
1105;
1106; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1107; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values
1108; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1109; IS__CGSCC_OPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR12]]
1110; IS__CGSCC_OPM-NEXT:    ret i1 [[R1]]
1111;
1112; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1113; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_merge_with_undef_values
1114; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1115; IS__CGSCC_NPM-NEXT:    [[R1:%.*]] = call noundef i1 @undef_then_1(i1 [[C]]) #[[ATTR11]]
1116; IS__CGSCC_NPM-NEXT:    ret i1 [[R1]]
1117;
1118  %r1 = call i1 @undef_then_1(i1 %c, i32 undef, i32 undef)
1119  ret i1 %r1
1120}
1121define internal i1 @undef_then_1(i1 %c, i32 %i32A, i32 %i32B) {
1122;
1123; IS__CGSCC____: Function Attrs: nofree nosync nounwind readnone willreturn
1124; IS__CGSCC____-LABEL: define {{[^@]+}}@undef_then_1
1125; IS__CGSCC____-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1126; IS__CGSCC____-NEXT:    br i1 [[C]], label [[A:%.*]], label [[B:%.*]]
1127; IS__CGSCC____:       a:
1128; IS__CGSCC____-NEXT:    ret i1 false
1129; IS__CGSCC____:       b:
1130; IS__CGSCC____-NEXT:    ret i1 false
1131;
1132  %cmp1 = icmp eq i32 %i32A, %i32B
1133  %cmp2 = icmp eq i1 %cmp1, false
1134  %or = or i1 %cmp2, %c
1135  br i1 %or, label %a, label %b
1136a:
1137  %r2 = call i1 @undef_then_1(i1 false, i32 1, i32 1)
1138  ret i1 %r2
1139b:
1140  ret i1 %cmp2
1141}
1142
1143define i32 @test_select(i32 %c) {
1144; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1145; IS__TUNIT____-LABEL: define {{[^@]+}}@test_select
1146; IS__TUNIT____-SAME: (i32 [[C:%.*]]) #[[ATTR1]] {
1147; IS__TUNIT____-NEXT:    ret i32 42
1148;
1149; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1150; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_select
1151; IS__CGSCC_OPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] {
1152; IS__CGSCC_OPM-NEXT:    [[CALL:%.*]] = call noundef i32 @select() #[[ATTR12]]
1153; IS__CGSCC_OPM-NEXT:    ret i32 [[CALL]]
1154;
1155; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1156; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_select
1157; IS__CGSCC_NPM-SAME: (i32 [[C:%.*]]) #[[ATTR2]] {
1158; IS__CGSCC_NPM-NEXT:    [[CALL:%.*]] = call noundef i32 @select() #[[ATTR11]]
1159; IS__CGSCC_NPM-NEXT:    ret i32 [[CALL]]
1160;
1161  %call = call i32 @select(i1 1, i32 42, i32 %c)
1162  ret i32 %call
1163}
1164
1165define internal i32 @select(i1 %a, i32 %b, i32 %c) {
1166; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1167; IS__CGSCC____-LABEL: define {{[^@]+}}@select
1168; IS__CGSCC____-SAME: () #[[ATTR1]] {
1169; IS__CGSCC____-NEXT:    ret i32 42
1170;
1171  %s = select i1 %a, i32 %b, i32 %c
1172  ret i32 %s
1173}
1174
1175define i1 @icmp() {
1176; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1177; CHECK-LABEL: define {{[^@]+}}@icmp
1178; CHECK-SAME: () #[[ATTR1]] {
1179; CHECK-NEXT:    ret i1 true
1180;
1181  %c = icmp eq i8* null, null
1182  ret i1 %c
1183}
1184
1185define void @test_callee_is_undef(void (i32)* %fn) {
1186; IS__TUNIT____-LABEL: define {{[^@]+}}@test_callee_is_undef
1187; IS__TUNIT____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) {
1188; IS__TUNIT____-NEXT:    call void @callee_is_undef()
1189; IS__TUNIT____-NEXT:    call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree [[FN]])
1190; IS__TUNIT____-NEXT:    ret void
1191;
1192; IS__CGSCC____-LABEL: define {{[^@]+}}@test_callee_is_undef
1193; IS__CGSCC____-SAME: (void (i32)* nocapture nofree [[FN:%.*]]) {
1194; IS__CGSCC____-NEXT:    call void @callee_is_undef()
1195; IS__CGSCC____-NEXT:    call void @unknown_calle_arg_is_undef(void (i32)* nocapture nofree noundef nonnull [[FN]])
1196; IS__CGSCC____-NEXT:    ret void
1197;
1198  call void @callee_is_undef(void ()* undef)
1199  call void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 undef)
1200  ret void
1201}
1202define internal void @callee_is_undef(void ()* %fn) {
1203;
1204; CHECK-LABEL: define {{[^@]+}}@callee_is_undef() {
1205; CHECK-NEXT:    call void poison()
1206; CHECK-NEXT:    ret void
1207;
1208  call void %fn()
1209  ret void
1210}
1211define internal void @unknown_calle_arg_is_undef(void (i32)* %fn, i32 %arg) {
1212;
1213; CHECK-LABEL: define {{[^@]+}}@unknown_calle_arg_is_undef
1214; CHECK-SAME: (void (i32)* nocapture nofree noundef nonnull [[FN:%.*]]) {
1215; CHECK-NEXT:    call void [[FN]](i32 undef)
1216; CHECK-NEXT:    ret void
1217;
1218  call void %fn(i32 %arg)
1219  ret void
1220}
1221
1222; Taken from 50683
1223; {{{
1224
1225@g = internal constant { [2 x i8*] } { [2 x i8*] [i8* bitcast (void (i8***)* @f1 to i8*), i8* bitcast (void (i1 (i8*)*)* @f2 to i8*)] }
1226
1227define internal void @f1(i8*** %a) {
1228; IS__TUNIT____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1229; IS__TUNIT____-LABEL: define {{[^@]+}}@f1
1230; IS__TUNIT____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR3]] {
1231; IS__TUNIT____-NEXT:  entry:
1232; IS__TUNIT____-NEXT:    store i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0), i8*** [[A]], align 8
1233; IS__TUNIT____-NEXT:    ret void
1234;
1235; IS__CGSCC____: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1236; IS__CGSCC____-LABEL: define {{[^@]+}}@f1
1237; IS__CGSCC____-SAME: (i8*** nocapture nofree noundef nonnull writeonly align 8 dereferenceable(8) [[A:%.*]]) #[[ATTR4]] {
1238; IS__CGSCC____-NEXT:  entry:
1239; IS__CGSCC____-NEXT:    store i8** getelementptr inbounds ({ [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0), i8*** [[A]], align 8
1240; IS__CGSCC____-NEXT:    ret void
1241;
1242entry:
1243  %x = getelementptr { [2 x i8*] }, { [2 x i8*] }* @g, i32 0, i32 0, i32 0
1244  store i8** %x , i8*** %a, align 8
1245  ret void
1246}
1247
1248define internal void @f2(i1 (i8*)* %a) {
1249; CHECK-LABEL: define {{[^@]+}}@f2
1250; CHECK-SAME: (i1 (i8*)* [[A:%.*]]) {
1251; CHECK-NEXT:  cont461:
1252; CHECK-NEXT:    [[C1:%.*]] = bitcast i1 (i8*)* [[A]] to i8*
1253; CHECK-NEXT:    call void @f3(i8* [[C1]], i1 (i8*)* nocapture nofree [[A]])
1254; CHECK-NEXT:    ret void
1255;
1256cont461:
1257  %c1 = bitcast i1 (i8*)* %a to i8*
1258  call void @f3(i8* %c1, i1 (i8*)* %a)
1259  ret void
1260}
1261
1262define internal void @f3(i8* %a1, i1 (i8*)* %a) {
1263; CHECK-LABEL: define {{[^@]+}}@f3
1264; CHECK-SAME: (i8* [[A1:%.*]], i1 (i8*)* nocapture nofree [[A:%.*]]) {
1265; CHECK-NEXT:  entry:
1266; CHECK-NEXT:    [[CALL20:%.*]] = call i1 @f9()
1267; CHECK-NEXT:    br i1 [[CALL20]], label [[LAND_LHS_TRUE:%.*]], label [[IF_END40:%.*]]
1268; CHECK:       land.lhs.true:
1269; CHECK-NEXT:    [[TMP0:%.*]] = call i1 [[A]](i8* [[A1]])
1270; CHECK-NEXT:    br label [[IF_END40]]
1271; CHECK:       if.end40:
1272; CHECK-NEXT:    ret void
1273;
1274entry:
1275  %call20 = call i1 @f9()
1276  br i1 %call20, label %land.lhs.true, label %if.end40
1277
1278land.lhs.true:
1279  call i1 %a(i8* %a1)
1280  br label %if.end40
1281
1282if.end40:
1283  ret void
1284}
1285
1286define linkonce_odr i1 @f9() {
1287; CHECK-LABEL: define {{[^@]+}}@f9() {
1288; CHECK-NEXT:  entry:
1289; CHECK-NEXT:    ret i1 false
1290;
1291entry:
1292  ret i1 false
1293}
1294
1295; }}}
1296
1297
1298define i1 @test_cmp_null_after_cast() {
1299; IS__TUNIT____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1300; IS__TUNIT____-LABEL: define {{[^@]+}}@test_cmp_null_after_cast
1301; IS__TUNIT____-SAME: () #[[ATTR1]] {
1302; IS__TUNIT____-NEXT:    ret i1 true
1303;
1304; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1305; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_cmp_null_after_cast
1306; IS__CGSCC_OPM-SAME: () #[[ATTR2]] {
1307; IS__CGSCC_OPM-NEXT:    [[C:%.*]] = call noundef i1 @cmp_null_after_cast() #[[ATTR12]]
1308; IS__CGSCC_OPM-NEXT:    ret i1 [[C]]
1309;
1310; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1311; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_cmp_null_after_cast
1312; IS__CGSCC_NPM-SAME: () #[[ATTR2]] {
1313; IS__CGSCC_NPM-NEXT:    [[C:%.*]] = call noundef i1 @cmp_null_after_cast() #[[ATTR11]]
1314; IS__CGSCC_NPM-NEXT:    ret i1 [[C]]
1315;
1316  %c = call i1 @cmp_null_after_cast(i32 0, i8 0)
1317  ret i1 %c
1318}
1319define internal i1 @cmp_null_after_cast(i32 %a, i8 %b) {
1320; IS__CGSCC____: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1321; IS__CGSCC____-LABEL: define {{[^@]+}}@cmp_null_after_cast
1322; IS__CGSCC____-SAME: () #[[ATTR1]] {
1323; IS__CGSCC____-NEXT:    ret i1 true
1324;
1325  %t = trunc i32 %a to i8
1326  %c = icmp eq i8 %t, %b
1327  ret i1 %c
1328}
1329
1330
1331declare i8* @m()
1332
1333define i32 @test(i1 %c) {
1334; IS__TUNIT____-LABEL: define {{[^@]+}}@test
1335; IS__TUNIT____-SAME: (i1 [[C:%.*]]) {
1336; IS__TUNIT____-NEXT:    [[R1:%.*]] = call i32 @ctx_test1(i1 [[C]])
1337; IS__TUNIT____-NEXT:    [[R2:%.*]] = call i32 @ctx_test2(i1 [[C]]), !range [[RNG0:![0-9]+]]
1338; IS__TUNIT____-NEXT:    [[ADD:%.*]] = add i32 [[R1]], [[R2]]
1339; IS__TUNIT____-NEXT:    ret i32 [[ADD]]
1340;
1341; IS__CGSCC____-LABEL: define {{[^@]+}}@test
1342; IS__CGSCC____-SAME: (i1 [[C:%.*]]) {
1343; IS__CGSCC____-NEXT:    [[R1:%.*]] = call i32 @ctx_test1(i1 [[C]])
1344; IS__CGSCC____-NEXT:    [[R2:%.*]] = call i32 @ctx_test2(i1 [[C]])
1345; IS__CGSCC____-NEXT:    [[ADD:%.*]] = add i32 [[R1]], [[R2]]
1346; IS__CGSCC____-NEXT:    ret i32 [[ADD]]
1347;
1348  %r1 = call i32 @ctx_test1(i1 %c)
1349  %r2 = call i32 @ctx_test2(i1 %c)
1350  %add = add i32 %r1, %r2
1351  ret i32 %add
1352}
1353
1354define internal i32 @ctx_test1(i1 %c) {
1355; CHECK-LABEL: define {{[^@]+}}@ctx_test1
1356; CHECK-SAME: (i1 [[C:%.*]]) {
1357; CHECK-NEXT:  entry:
1358; CHECK-NEXT:    br i1 [[C]], label [[THEN:%.*]], label [[JOIN:%.*]]
1359; CHECK:       then:
1360; CHECK-NEXT:    [[M:%.*]] = tail call i8* @m()
1361; CHECK-NEXT:    [[I:%.*]] = ptrtoint i8* [[M]] to i64
1362; CHECK-NEXT:    br label [[JOIN]]
1363; CHECK:       join:
1364; CHECK-NEXT:    [[PHI:%.*]] = phi i64 [ [[I]], [[THEN]] ], [ undef, [[ENTRY:%.*]] ]
1365; CHECK-NEXT:    [[RET:%.*]] = trunc i64 [[PHI]] to i32
1366; CHECK-NEXT:    ret i32 [[RET]]
1367;
1368entry:
1369  br i1 %c, label %then, label %join
1370
1371then:
1372  %m = tail call i8* @m()
1373  %i = ptrtoint i8* %m to i64
1374  br label %join
1375
1376join:
1377  %phi = phi i64 [ %i, %then ], [ undef, %entry ]
1378  %ret = trunc i64 %phi to i32
1379  ret i32 %ret
1380}
1381
1382define internal i32 @ctx_test2(i1 %c) {
1383; CHECK-LABEL: define {{[^@]+}}@ctx_test2
1384; CHECK-SAME: (i1 [[C:%.*]]) {
1385; CHECK-NEXT:  entry:
1386; CHECK-NEXT:    br i1 [[C]], label [[THEN:%.*]], label [[JOIN:%.*]]
1387; CHECK:       then:
1388; CHECK-NEXT:    [[M:%.*]] = tail call i8* @m()
1389; CHECK-NEXT:    [[I:%.*]] = ptrtoint i8* [[M]] to i32
1390; CHECK-NEXT:    br label [[JOIN]]
1391; CHECK:       join:
1392; CHECK-NEXT:    [[PHI:%.*]] = phi i32 [ [[I]], [[THEN]] ], [ undef, [[ENTRY:%.*]] ]
1393; CHECK-NEXT:    [[RET:%.*]] = lshr i32 [[PHI]], 1
1394; CHECK-NEXT:    ret i32 [[RET]]
1395;
1396entry:
1397  br i1 %c, label %then, label %join
1398
1399then:
1400  %m = tail call i8* @m()
1401  %i = ptrtoint i8* %m to i32
1402  br label %join
1403
1404join:
1405  %phi = phi i32 [ %i, %then ], [ undef, %entry ]
1406  %ret = lshr i32 %phi, 1
1407  ret i32 %ret
1408
1409  uselistorder label %join, { 1, 0 }
1410}
1411
1412define i1 @test_liveness(i1 %c) {
1413; IS__TUNIT_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1414; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_liveness
1415; IS__TUNIT_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1416; IS__TUNIT_OPM-NEXT:  entry:
1417; IS__TUNIT_OPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1418; IS__TUNIT_OPM:       t:
1419; IS__TUNIT_OPM-NEXT:    br label [[F]]
1420; IS__TUNIT_OPM:       f:
1421; IS__TUNIT_OPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1422; IS__TUNIT_OPM-NEXT:    [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR11]]
1423; IS__TUNIT_OPM-NEXT:    ret i1 [[RC1]]
1424;
1425; IS__TUNIT_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1426; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_liveness
1427; IS__TUNIT_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR1]] {
1428; IS__TUNIT_NPM-NEXT:  entry:
1429; IS__TUNIT_NPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1430; IS__TUNIT_NPM:       t:
1431; IS__TUNIT_NPM-NEXT:    br label [[F]]
1432; IS__TUNIT_NPM:       f:
1433; IS__TUNIT_NPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1434; IS__TUNIT_NPM-NEXT:    [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR10]]
1435; IS__TUNIT_NPM-NEXT:    ret i1 [[RC1]]
1436;
1437; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind readnone willreturn
1438; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_liveness
1439; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1440; IS__CGSCC_OPM-NEXT:  entry:
1441; IS__CGSCC_OPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1442; IS__CGSCC_OPM:       t:
1443; IS__CGSCC_OPM-NEXT:    br label [[F]]
1444; IS__CGSCC_OPM:       f:
1445; IS__CGSCC_OPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1446; IS__CGSCC_OPM-NEXT:    [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR12]]
1447; IS__CGSCC_OPM-NEXT:    ret i1 [[RC1]]
1448;
1449; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind readnone willreturn
1450; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_liveness
1451; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]]) #[[ATTR2]] {
1452; IS__CGSCC_NPM-NEXT:  entry:
1453; IS__CGSCC_NPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1454; IS__CGSCC_NPM:       t:
1455; IS__CGSCC_NPM-NEXT:    br label [[F]]
1456; IS__CGSCC_NPM:       f:
1457; IS__CGSCC_NPM-NEXT:    [[P:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ false, [[T]] ]
1458; IS__CGSCC_NPM-NEXT:    [[RC1:%.*]] = call noundef i1 @ret(i1 noundef [[P]]) #[[ATTR11]]
1459; IS__CGSCC_NPM-NEXT:    ret i1 [[RC1]]
1460;
1461entry:
1462  br i1 %c, label %t, label %f
1463t:
1464  br label %f
1465f:
1466  %p = phi i1 [true, %entry], [false, %t]
1467  %rc1 = call i1 @ret(i1 %p)
1468  ret i1 %rc1
1469}
1470
1471define internal i1 @ret(i1 %c) {
1472; IS________OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1473; IS________OPM-LABEL: define {{[^@]+}}@ret
1474; IS________OPM-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] {
1475; IS________OPM-NEXT:  entry:
1476; IS________OPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1477; IS________OPM:       t:
1478; IS________OPM-NEXT:    br label [[F]]
1479; IS________OPM:       f:
1480; IS________OPM-NEXT:    [[P:%.*]] = phi i1 [ [[C]], [[ENTRY:%.*]] ], [ false, [[T]] ]
1481; IS________OPM-NEXT:    ret i1 [[P]]
1482;
1483; IS________NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1484; IS________NPM-LABEL: define {{[^@]+}}@ret
1485; IS________NPM-SAME: (i1 noundef [[C:%.*]]) #[[ATTR1]] {
1486; IS________NPM-NEXT:  entry:
1487; IS________NPM-NEXT:    br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
1488; IS________NPM:       t:
1489; IS________NPM-NEXT:    br label [[F]]
1490; IS________NPM:       f:
1491; IS________NPM-NEXT:    [[P:%.*]] = phi i1 [ [[C]], [[ENTRY:%.*]] ], [ false, [[T]] ]
1492; IS________NPM-NEXT:    ret i1 false
1493;
1494entry:
1495  br i1 %c, label %t, label %f
1496t:
1497  br label %f
1498f:
1499  %p = phi i1 [%c, %entry], [false, %t]
1500  ret i1 %p
1501}
1502
1503declare i8* @unknown()
1504define internal i8 @dead_ret() {
1505; CHECK-LABEL: define {{[^@]+}}@dead_ret() {
1506; CHECK-NEXT:    [[R:%.*]] = call i8* @unknown()
1507; CHECK-NEXT:    ret i8 undef
1508;
1509  %r = call i8* @unknown()
1510  %l = load i8, i8* %r
1511  ret i8 %l
1512}
1513
1514define void @dead_ret_caller() {
1515; CHECK-LABEL: define {{[^@]+}}@dead_ret_caller() {
1516; CHECK-NEXT:    [[R:%.*]] = call i8 @dead_ret()
1517; CHECK-NEXT:    ret void
1518;
1519  %r = call i8 @dead_ret()
1520  ret void
1521}
1522
1523declare void @llvm.memcpy(i8* %dest, i8* %src, i32 %len, i1 %isvolatile)
1524define internal i8 @memcpy_uses_store(i8 %arg) {
1525; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
1526; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1527; IS__TUNIT_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR6:[0-9]+]] {
1528; IS__TUNIT_OPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1529; IS__TUNIT_OPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1530; IS__TUNIT_OPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1531; 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) #[[ATTR12]]
1532; IS__TUNIT_OPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1533; IS__TUNIT_OPM-NEXT:    ret i8 [[L]]
1534;
1535; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
1536; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1537; IS__TUNIT_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR5:[0-9]+]] {
1538; IS__TUNIT_NPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1539; IS__TUNIT_NPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1540; IS__TUNIT_NPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1541; 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) #[[ATTR11]]
1542; IS__TUNIT_NPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1543; IS__TUNIT_NPM-NEXT:    ret i8 [[L]]
1544;
1545; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
1546; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1547; IS__CGSCC_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] {
1548; IS__CGSCC_OPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1549; IS__CGSCC_OPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1550; IS__CGSCC_OPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1551; 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) #[[ATTR13]]
1552; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1553; IS__CGSCC_OPM-NEXT:    ret i8 [[L]]
1554;
1555; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
1556; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store
1557; IS__CGSCC_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] {
1558; IS__CGSCC_NPM-NEXT:    [[SRC:%.*]] = alloca i8, align 1
1559; IS__CGSCC_NPM-NEXT:    [[DST:%.*]] = alloca i8, align 1
1560; IS__CGSCC_NPM-NEXT:    store i8 [[ARG]], i8* [[SRC]], align 1
1561; 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) #[[ATTR12]]
1562; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = load i8, i8* [[DST]], align 1
1563; IS__CGSCC_NPM-NEXT:    ret i8 [[L]]
1564;
1565  %src = alloca i8
1566  %dst = alloca i8
1567  store i8 %arg, i8* %src
1568  call void @llvm.memcpy(i8* %dst, i8* %src, i32 1, i1 false)
1569  %l = load i8, i8* %dst
1570  ret i8 %l
1571}
1572
1573define i8 @memcpy_uses_store_caller(i8 %arg) {
1574; IS__TUNIT_OPM: Function Attrs: nofree nosync nounwind willreturn
1575; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1576; IS__TUNIT_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR6]] {
1577; IS__TUNIT_OPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR6]]
1578; IS__TUNIT_OPM-NEXT:    ret i8 [[R]]
1579;
1580; IS__TUNIT_NPM: Function Attrs: nofree nosync nounwind willreturn
1581; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1582; IS__TUNIT_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR5]] {
1583; IS__TUNIT_NPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR5]]
1584; IS__TUNIT_NPM-NEXT:    ret i8 [[R]]
1585;
1586; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind willreturn
1587; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1588; IS__CGSCC_OPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] {
1589; IS__CGSCC_OPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR15:[0-9]+]]
1590; IS__CGSCC_OPM-NEXT:    ret i8 [[R]]
1591;
1592; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind willreturn
1593; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@memcpy_uses_store_caller
1594; IS__CGSCC_NPM-SAME: (i8 [[ARG:%.*]]) #[[ATTR3]] {
1595; IS__CGSCC_NPM-NEXT:    [[R:%.*]] = call i8 @memcpy_uses_store(i8 [[ARG]]) #[[ATTR14:[0-9]+]]
1596; IS__CGSCC_NPM-NEXT:    ret i8 [[R]]
1597;
1598  %r = call i8 @memcpy_uses_store(i8 %arg)
1599  ret i8 %r
1600}
1601
1602
1603declare i32 @speculatable() speculatable readnone
1604
1605define i32 @test_speculatable_expr() norecurse {
1606; IS__TUNIT_OPM: Function Attrs: norecurse nosync readnone
1607; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1608; IS__TUNIT_OPM-SAME: () #[[ATTR8:[0-9]+]] {
1609; IS__TUNIT_OPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1610; IS__TUNIT_OPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1611; IS__TUNIT_OPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1612; IS__TUNIT_OPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1613; 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]+]]
1614; IS__TUNIT_OPM-NEXT:    ret i32 [[RSPEC]]
1615;
1616; IS__TUNIT_NPM: Function Attrs: norecurse nosync readnone
1617; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1618; IS__TUNIT_NPM-SAME: () #[[ATTR7:[0-9]+]] {
1619; IS__TUNIT_NPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1620; IS__TUNIT_NPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1621; IS__TUNIT_NPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1622; IS__TUNIT_NPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1623; IS__TUNIT_NPM-NEXT:    [[TMP1:%.*]] = load i32, i32* [[STACK]], align 4
1624; IS__TUNIT_NPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32 [[TMP1]]) #[[ATTR13:[0-9]+]]
1625; IS__TUNIT_NPM-NEXT:    ret i32 [[RSPEC]]
1626;
1627; IS__CGSCC_OPM: Function Attrs: norecurse nosync readnone
1628; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1629; IS__CGSCC_OPM-SAME: () #[[ATTR9:[0-9]+]] {
1630; IS__CGSCC_OPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1631; IS__CGSCC_OPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1632; IS__CGSCC_OPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1633; IS__CGSCC_OPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1634; IS__CGSCC_OPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[STACK]]) #[[ATTR16:[0-9]+]]
1635; IS__CGSCC_OPM-NEXT:    ret i32 [[RSPEC]]
1636;
1637; IS__CGSCC_NPM: Function Attrs: norecurse nosync readnone
1638; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test_speculatable_expr
1639; IS__CGSCC_NPM-SAME: () #[[ATTR8:[0-9]+]] {
1640; IS__CGSCC_NPM-NEXT:    [[STACK:%.*]] = alloca i32, align 4
1641; IS__CGSCC_NPM-NEXT:    [[SPEC_RESULT:%.*]] = call i32 @speculatable()
1642; IS__CGSCC_NPM-NEXT:    [[PLUS1:%.*]] = add i32 [[SPEC_RESULT]], 1
1643; IS__CGSCC_NPM-NEXT:    store i32 [[PLUS1]], i32* [[STACK]], align 4
1644; IS__CGSCC_NPM-NEXT:    [[RSPEC:%.*]] = call i32 @ret_speculatable_expr(i32 [[PLUS1]]) #[[ATTR15:[0-9]+]]
1645; IS__CGSCC_NPM-NEXT:    ret i32 [[RSPEC]]
1646;
1647  %stack = alloca i32
1648  %spec_result = call i32 @speculatable()
1649  %plus1 = add i32 %spec_result, 1
1650  store i32 %plus1, i32* %stack
1651  %rspec = call i32 @ret_speculatable_expr(i32* %stack, i32 13)
1652  ret i32 %rspec
1653}
1654
1655define internal i32 @ret_speculatable_expr(i32* %mem, i32 %a2) {
1656; IS__TUNIT_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1657; IS__TUNIT_OPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1658; IS__TUNIT_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[MEM:%.*]]) #[[ATTR9:[0-9]+]] {
1659; IS__TUNIT_OPM-NEXT:    [[TMP1:%.*]] = call i32 @speculatable()
1660; IS__TUNIT_OPM-NEXT:    [[TMP2:%.*]] = add i32 [[TMP1]], 1
1661; IS__TUNIT_OPM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP2]], 13
1662; IS__TUNIT_OPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1663; IS__TUNIT_OPM-NEXT:    ret i32 [[ADD]]
1664;
1665; IS__TUNIT_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1666; IS__TUNIT_NPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1667; IS__TUNIT_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR8:[0-9]+]] {
1668; IS__TUNIT_NPM-NEXT:    [[MEM_PRIV:%.*]] = alloca i32, align 4
1669; IS__TUNIT_NPM-NEXT:    store i32 [[TMP0]], i32* [[MEM_PRIV]], align 4
1670; IS__TUNIT_NPM-NEXT:    [[TMP2:%.*]] = call i32 @speculatable()
1671; IS__TUNIT_NPM-NEXT:    [[TMP3:%.*]] = add i32 [[TMP2]], 1
1672; IS__TUNIT_NPM-NEXT:    [[MUL:%.*]] = mul i32 [[TMP3]], 13
1673; IS__TUNIT_NPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1674; IS__TUNIT_NPM-NEXT:    ret i32 [[ADD]]
1675;
1676; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1677; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1678; IS__CGSCC_OPM-SAME: (i32* noalias nocapture nofree noundef nonnull readonly align 4 dereferenceable(4) [[MEM:%.*]]) #[[ATTR10:[0-9]+]] {
1679; IS__CGSCC_OPM-NEXT:    [[L:%.*]] = load i32, i32* [[MEM]], align 4
1680; IS__CGSCC_OPM-NEXT:    [[MUL:%.*]] = mul i32 [[L]], 13
1681; IS__CGSCC_OPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1682; IS__CGSCC_OPM-NEXT:    ret i32 [[ADD]]
1683;
1684; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1685; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ret_speculatable_expr
1686; IS__CGSCC_NPM-SAME: (i32 [[TMP0:%.*]]) #[[ATTR9:[0-9]+]] {
1687; IS__CGSCC_NPM-NEXT:    [[MEM_PRIV:%.*]] = alloca i32, align 4
1688; IS__CGSCC_NPM-NEXT:    store i32 [[TMP0]], i32* [[MEM_PRIV]], align 4
1689; IS__CGSCC_NPM-NEXT:    [[L:%.*]] = load i32, i32* [[MEM_PRIV]], align 4
1690; IS__CGSCC_NPM-NEXT:    [[MUL:%.*]] = mul i32 [[L]], 13
1691; IS__CGSCC_NPM-NEXT:    [[ADD:%.*]] = add i32 [[MUL]], 7
1692; IS__CGSCC_NPM-NEXT:    ret i32 [[ADD]]
1693;
1694  %l = load i32, i32* %mem
1695  %mul = mul i32 %l, %a2
1696  %add = add i32 %mul, 7
1697  ret i32 %add
1698}
1699
1700
1701;.
1702; IS__TUNIT_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1703; IS__TUNIT_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1704; IS__TUNIT_OPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn }
1705; IS__TUNIT_OPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1706; IS__TUNIT_OPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
1707; IS__TUNIT_OPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind writeonly }
1708; IS__TUNIT_OPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn }
1709; IS__TUNIT_OPM: attributes #[[ATTR7:[0-9]+]] = { readnone speculatable }
1710; IS__TUNIT_OPM: attributes #[[ATTR8]] = { norecurse nosync readnone }
1711; IS__TUNIT_OPM: attributes #[[ATTR9]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1712; IS__TUNIT_OPM: attributes #[[ATTR10:[0-9]+]] = { argmemonly nofree nounwind willreturn }
1713; IS__TUNIT_OPM: attributes #[[ATTR11]] = { nofree nosync nounwind readnone willreturn }
1714; IS__TUNIT_OPM: attributes #[[ATTR12]] = { willreturn }
1715; IS__TUNIT_OPM: attributes #[[ATTR13]] = { nofree nosync nounwind willreturn writeonly }
1716; IS__TUNIT_OPM: attributes #[[ATTR14]] = { nosync nounwind readonly }
1717;.
1718; IS__TUNIT_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1719; IS__TUNIT_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1720; IS__TUNIT_NPM: attributes #[[ATTR2]] = { nofree norecurse nosync nounwind willreturn }
1721; IS__TUNIT_NPM: attributes #[[ATTR3]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1722; IS__TUNIT_NPM: attributes #[[ATTR4]] = { nofree norecurse nosync nounwind willreturn writeonly }
1723; IS__TUNIT_NPM: attributes #[[ATTR5]] = { nofree nosync nounwind willreturn }
1724; IS__TUNIT_NPM: attributes #[[ATTR6:[0-9]+]] = { readnone speculatable }
1725; IS__TUNIT_NPM: attributes #[[ATTR7]] = { norecurse nosync readnone }
1726; IS__TUNIT_NPM: attributes #[[ATTR8]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1727; IS__TUNIT_NPM: attributes #[[ATTR9:[0-9]+]] = { argmemonly nofree nounwind willreturn }
1728; IS__TUNIT_NPM: attributes #[[ATTR10]] = { nofree nosync nounwind readnone willreturn }
1729; IS__TUNIT_NPM: attributes #[[ATTR11]] = { willreturn }
1730; IS__TUNIT_NPM: attributes #[[ATTR12]] = { nofree nosync nounwind willreturn writeonly }
1731; IS__TUNIT_NPM: attributes #[[ATTR13]] = { nosync nounwind readonly }
1732;.
1733; IS__CGSCC_OPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1734; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1735; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn }
1736; IS__CGSCC_OPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
1737; IS__CGSCC_OPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1738; IS__CGSCC_OPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly }
1739; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind writeonly }
1740; IS__CGSCC_OPM: attributes #[[ATTR7]] = { nofree nosync nounwind willreturn writeonly }
1741; IS__CGSCC_OPM: attributes #[[ATTR8:[0-9]+]] = { readnone speculatable }
1742; IS__CGSCC_OPM: attributes #[[ATTR9]] = { norecurse nosync readnone }
1743; IS__CGSCC_OPM: attributes #[[ATTR10]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1744; IS__CGSCC_OPM: attributes #[[ATTR11:[0-9]+]] = { argmemonly nofree nounwind willreturn }
1745; IS__CGSCC_OPM: attributes #[[ATTR12]] = { readnone willreturn }
1746; IS__CGSCC_OPM: attributes #[[ATTR13]] = { willreturn }
1747; IS__CGSCC_OPM: attributes #[[ATTR14]] = { nounwind willreturn writeonly }
1748; IS__CGSCC_OPM: attributes #[[ATTR15]] = { nounwind willreturn }
1749; IS__CGSCC_OPM: attributes #[[ATTR16]] = { readonly }
1750;.
1751; IS__CGSCC_NPM: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nosync nounwind willreturn }
1752; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree norecurse nosync nounwind readnone willreturn }
1753; IS__CGSCC_NPM: attributes #[[ATTR2]] = { nofree nosync nounwind readnone willreturn }
1754; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nofree nosync nounwind willreturn }
1755; IS__CGSCC_NPM: attributes #[[ATTR4]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1756; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly }
1757; IS__CGSCC_NPM: attributes #[[ATTR6]] = { nofree nosync nounwind willreturn writeonly }
1758; IS__CGSCC_NPM: attributes #[[ATTR7:[0-9]+]] = { readnone speculatable }
1759; IS__CGSCC_NPM: attributes #[[ATTR8]] = { norecurse nosync readnone }
1760; IS__CGSCC_NPM: attributes #[[ATTR9]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1761; IS__CGSCC_NPM: attributes #[[ATTR10:[0-9]+]] = { argmemonly nofree nounwind willreturn }
1762; IS__CGSCC_NPM: attributes #[[ATTR11]] = { readnone willreturn }
1763; IS__CGSCC_NPM: attributes #[[ATTR12]] = { willreturn }
1764; IS__CGSCC_NPM: attributes #[[ATTR13]] = { nounwind willreturn writeonly }
1765; IS__CGSCC_NPM: attributes #[[ATTR14]] = { nounwind willreturn }
1766; IS__CGSCC_NPM: attributes #[[ATTR15]] = { readonly }
1767;.
1768; IS__TUNIT____: [[RNG0]] = !{i32 0, i32 -2147483648}
1769;.
1770