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=8 -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=8 -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
7 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
9 ; Test cases specifically designed for "align" attribute.
10 ; We use FIXME's to indicate problems and missing attributes.
16 ; CHECK: @[[A1:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 8
17 ; CHECK: @[[A2:[a-zA-Z0-9_$"\\.-]+]] = common global i8 0, align 16
18 ; CHECK: @[[CND:[a-zA-Z0-9_$"\\.-]+]] = external global i1
20 define i32* @test1(i32* align 8 %0) #0 {
21 ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
22 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test1
23 ; IS__TUNIT____-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
24 ; IS__TUNIT____-NEXT: ret i32* [[TMP0]]
26 ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
27 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test1
28 ; IS__CGSCC____-SAME: (i32* nofree readnone returned align 8 "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0:[0-9]+]] {
29 ; IS__CGSCC____-NEXT: ret i32* [[TMP0]]
35 define i32* @test2(i32* %0) #0 {
36 ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
37 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test2
38 ; IS__TUNIT____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] {
39 ; IS__TUNIT____-NEXT: ret i32* [[TMP0]]
41 ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
42 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test2
43 ; IS__CGSCC____-SAME: (i32* nofree readnone returned "no-capture-maybe-returned" [[TMP0:%.*]]) #[[ATTR0]] {
44 ; IS__CGSCC____-NEXT: ret i32* [[TMP0]]
50 define i32* @test3(i32* align 8 %0, i32* align 4 %1, i1 %2) #0 {
51 ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
52 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test3
53 ; IS__TUNIT____-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] {
54 ; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]]
55 ; IS__TUNIT____-NEXT: ret i32* [[RET]]
57 ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
58 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test3
59 ; IS__CGSCC____-SAME: (i32* nofree readnone align 8 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 4 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] {
60 ; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]]
61 ; IS__CGSCC____-NEXT: ret i32* [[RET]]
63 %ret = select i1 %2, i32* %0, i32* %1
68 define i32* @test4(i32* align 32 %0, i32* align 32 %1, i1 %2) #0 {
69 ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
70 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test4
71 ; IS__TUNIT____-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] {
72 ; IS__TUNIT____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]]
73 ; IS__TUNIT____-NEXT: ret i32* [[RET]]
75 ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
76 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test4
77 ; IS__CGSCC____-SAME: (i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP0:%.*]], i32* nofree readnone align 32 "no-capture-maybe-returned" [[TMP1:%.*]], i1 [[TMP2:%.*]]) #[[ATTR0]] {
78 ; IS__CGSCC____-NEXT: [[RET:%.*]] = select i1 [[TMP2]], i32* [[TMP0]], i32* [[TMP1]]
79 ; IS__CGSCC____-NEXT: ret i32* [[RET]]
81 %ret = select i1 %2, i32* %0, i32* %1
86 declare i32* @unknown()
87 declare align 8 i32* @align8()
90 define i32* @test5_1() {
91 ; CHECK-LABEL: define {{[^@]+}}@test5_1() {
92 ; CHECK-NEXT: [[RET:%.*]] = tail call align 8 i32* @unknown()
93 ; CHECK-NEXT: ret i32* [[RET]]
95 %ret = tail call align 8 i32* @unknown()
99 define i32* @test5_2() {
100 ; CHECK-LABEL: define {{[^@]+}}@test5_2() {
101 ; CHECK-NEXT: [[RET:%.*]] = tail call align 8 i32* @align8()
102 ; CHECK-NEXT: ret i32* [[RET]]
104 %ret = tail call i32* @align8()
110 define i32* @test6_1() #0 {
111 ; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn
112 ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1
113 ; NOT_CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] {
114 ; NOT_CGSCC_NPM-NEXT: unreachable
116 ; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn
117 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_1
118 ; IS__CGSCC_NPM-SAME: () #[[ATTR1:[0-9]+]] {
119 ; IS__CGSCC_NPM-NEXT: unreachable
121 %ret = tail call i32* @test6_2()
125 define i32* @test6_2() #0 {
126 ; NOT_CGSCC_NPM: Function Attrs: nofree noinline noreturn nosync nounwind readnone uwtable willreturn
127 ; NOT_CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2
128 ; NOT_CGSCC_NPM-SAME: () #[[ATTR1]] {
129 ; NOT_CGSCC_NPM-NEXT: unreachable
131 ; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn
132 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test6_2
133 ; IS__CGSCC_NPM-SAME: () #[[ATTR1]] {
134 ; IS__CGSCC_NPM-NEXT: unreachable
136 %ret = tail call i32* @test6_1()
141 ; char a1 __attribute__((aligned(8)));
142 ; char a2 __attribute__((aligned(16)));
144 ; char* f1(char* a ){
145 ; return a?a:f2(&a1);
148 ; return a?f1(a):f3(&a2);
152 ; return a?&a1: f1(&a2);
155 @a1 = common global i8 0, align 8
156 @a2 = common global i8 0, align 16
158 ; Function Attrs: nounwind readnone ssp uwtable
159 define internal i8* @f1(i8* readnone %0) local_unnamed_addr #0 {
160 ; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
161 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1
162 ; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
163 ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]]
165 ; IS__CGSCC_OPM-NEXT: unreachable
167 ; IS__CGSCC_OPM-NEXT: ret i8* undef
169 ; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
170 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1
171 ; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] {
172 ; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]]
174 ; IS__CGSCC_NPM-NEXT: unreachable
176 ; IS__CGSCC_NPM-NEXT: ret i8* undef
178 %2 = icmp eq i8* %0, null
179 br i1 %2, label %3, label %5
181 ; <label>:3: ; preds = %1
182 %4 = tail call i8* @f2(i8* nonnull @a1)
186 ; <label>:5: ; preds = %1, %3
187 %6 = phi i8* [ %4, %3 ], [ %0, %1 ]
191 ; Function Attrs: nounwind readnone ssp uwtable
192 define internal i8* @f2(i8* readnone %0) local_unnamed_addr #0 {
193 ; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
194 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2
195 ; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3:[0-9]+]] {
196 ; IS__CGSCC_OPM-NEXT: unreachable
198 ; IS__CGSCC_OPM-NEXT: unreachable
200 ; IS__CGSCC_OPM-NEXT: unreachable
202 ; IS__CGSCC_OPM-NEXT: unreachable
204 ; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
205 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2
206 ; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2:[0-9]+]] {
207 ; IS__CGSCC_NPM-NEXT: unreachable
209 ; IS__CGSCC_NPM-NEXT: unreachable
211 ; IS__CGSCC_NPM-NEXT: unreachable
213 ; IS__CGSCC_NPM-NEXT: unreachable
215 %2 = icmp eq i8* %0, null
216 br i1 %2, label %5, label %3
218 ; <label>:3: ; preds = %1
220 %4 = tail call i8* @f1(i8* nonnull %0)
223 ; <label>:5: ; preds = %1
224 %6 = tail call i8* @f3(i8* nonnull @a2)
227 ; <label>:7: ; preds = %5, %3
228 %8 = phi i8* [ %4, %3 ], [ %6, %5 ]
232 ; Function Attrs: nounwind readnone ssp uwtable
233 define internal i8* @f3(i8* readnone %0) local_unnamed_addr #0 {
234 ; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
235 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3
236 ; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3]] {
237 ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]]
239 ; IS__CGSCC_OPM-NEXT: unreachable
241 ; IS__CGSCC_OPM-NEXT: ret i8* @a1
243 ; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
244 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3
245 ; IS__CGSCC_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
246 ; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]]
248 ; IS__CGSCC_NPM-NEXT: unreachable
250 ; IS__CGSCC_NPM-NEXT: ret i8* @a1
252 %2 = icmp eq i8* %0, null
253 br i1 %2, label %3, label %5
255 ; <label>:3: ; preds = %1
256 %4 = tail call i8* @f1(i8* nonnull @a2)
259 ; <label>:5: ; preds = %1, %3
260 %6 = phi i8* [ %4, %3 ], [ @a1, %1 ]
265 ; Better than IR information
266 define align 4 i8* @test7() #0 {
267 ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
268 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test7
269 ; IS__TUNIT____-SAME: () #[[ATTR0]] {
270 ; IS__TUNIT____-NEXT: ret i8* @a1
272 ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
273 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test7
274 ; IS__CGSCC____-SAME: () #[[ATTR0]] {
275 ; IS__CGSCC____-NEXT: ret i8* @a1
277 %c = tail call i8* @f1(i8* align 8 dereferenceable(1) @a1)
282 ; Function Attrs: nounwind readnone ssp uwtable
283 define internal i8* @f1b(i8* readnone %0) local_unnamed_addr #0 {
284 ; IS__CGSCC_OPM: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
285 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f1b
286 ; IS__CGSCC_OPM-SAME: (i8* noalias nocapture nofree nonnull readnone align 8 dereferenceable(1) [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
287 ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]]
289 ; IS__CGSCC_OPM-NEXT: unreachable
291 ; IS__CGSCC_OPM-NEXT: ret i8* undef
293 ; IS__CGSCC_NPM: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
294 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f1b
295 ; IS__CGSCC_NPM-SAME: () local_unnamed_addr #[[ATTR0]] {
296 ; IS__CGSCC_NPM-NEXT: br label [[TMP2:%.*]]
298 ; IS__CGSCC_NPM-NEXT: unreachable
300 ; IS__CGSCC_NPM-NEXT: ret i8* undef
302 %2 = icmp eq i8* %0, null
303 br i1 %2, label %3, label %5
305 ; <label>:3: ; preds = %1
306 %4 = tail call i8* @f2b(i8* nonnull @a1)
311 ; <label>:5: ; preds = %1, %3
312 %6 = phi i8* [ %4, %3 ], [ %0, %1 ]
316 ; Function Attrs: nounwind readnone ssp uwtable
317 define internal i8* @f2b(i8* readnone %0) local_unnamed_addr #0 {
319 ; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
320 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f2b
321 ; IS__CGSCC_OPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3]] {
322 ; IS__CGSCC_OPM-NEXT: unreachable
324 ; IS__CGSCC_OPM-NEXT: unreachable
326 ; IS__CGSCC_OPM-NEXT: unreachable
328 ; IS__CGSCC_OPM-NEXT: unreachable
330 ; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
331 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f2b
332 ; IS__CGSCC_NPM-SAME: (i8* readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
333 ; IS__CGSCC_NPM-NEXT: unreachable
335 ; IS__CGSCC_NPM-NEXT: unreachable
337 ; IS__CGSCC_NPM-NEXT: unreachable
339 ; IS__CGSCC_NPM-NEXT: unreachable
341 %2 = icmp eq i8* %0, null
342 br i1 %2, label %5, label %3
344 ; <label>:3: ; preds = %1
346 %4 = tail call i8* @f1b(i8* nonnull %0)
349 ; <label>:5: ; preds = %1
350 %6 = tail call i8* @f3b(i8* nonnull @a2)
353 ; <label>:7: ; preds = %5, %3
354 %8 = phi i8* [ %4, %3 ], [ %6, %5 ]
358 ; Function Attrs: nounwind readnone ssp uwtable
359 define internal i8* @f3b(i8* readnone %0) local_unnamed_addr #0 {
361 ; IS__CGSCC_OPM: Function Attrs: noinline nounwind uwtable
362 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@f3b
363 ; IS__CGSCC_OPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR3]] {
364 ; IS__CGSCC_OPM-NEXT: br label [[TMP3:%.*]]
366 ; IS__CGSCC_OPM-NEXT: unreachable
368 ; IS__CGSCC_OPM-NEXT: ret i8* @a1
370 ; IS__CGSCC_NPM: Function Attrs: noinline nounwind uwtable
371 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@f3b
372 ; IS__CGSCC_NPM-SAME: (i8* nonnull readnone [[TMP0:%.*]]) local_unnamed_addr #[[ATTR2]] {
373 ; IS__CGSCC_NPM-NEXT: br label [[TMP3:%.*]]
375 ; IS__CGSCC_NPM-NEXT: unreachable
377 ; IS__CGSCC_NPM-NEXT: ret i8* @a1
379 %2 = icmp eq i8* %0, null
380 br i1 %2, label %3, label %5
382 ; <label>:3: ; preds = %1
383 %4 = tail call i8* @f1b(i8* nonnull @a2)
386 ; <label>:5: ; preds = %1, %3
387 %6 = phi i8* [ %4, %3 ], [ @a1, %1 ]
391 define align 4 i32* @test7b(i32* align 32 %p) #0 {
392 ; IS__TUNIT____: Function Attrs: nofree noinline nosync nounwind readnone uwtable willreturn
393 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test7b
394 ; IS__TUNIT____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] {
395 ; IS__TUNIT____-NEXT: ret i32* [[P]]
397 ; IS__CGSCC____: Function Attrs: nofree noinline norecurse nosync nounwind readnone uwtable willreturn
398 ; IS__CGSCC____-LABEL: define {{[^@]+}}@test7b
399 ; IS__CGSCC____-SAME: (i32* nofree readnone returned align 32 "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR0]] {
400 ; IS__CGSCC____-NEXT: ret i32* [[P]]
402 tail call i8* @f1b(i8* align 8 dereferenceable(1) @a1)
407 define void @test8_helper() {
408 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test8_helper() {
409 ; IS__TUNIT____-NEXT: [[PTR0:%.*]] = tail call i32* @unknown()
410 ; IS__TUNIT____-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown()
411 ; IS__TUNIT____-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown()
412 ; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR2:[0-9]+]]
413 ; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]]
414 ; IS__TUNIT____-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR2]]
415 ; IS__TUNIT____-NEXT: ret void
417 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8_helper() {
418 ; IS__CGSCC_OPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown()
419 ; IS__CGSCC_OPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown()
420 ; IS__CGSCC_OPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown()
421 ; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR4:[0-9]+]]
422 ; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR4]]
423 ; IS__CGSCC_OPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR4]]
424 ; IS__CGSCC_OPM-NEXT: ret void
426 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8_helper() {
427 ; IS__CGSCC_NPM-NEXT: [[PTR0:%.*]] = tail call i32* @unknown()
428 ; IS__CGSCC_NPM-NEXT: [[PTR1:%.*]] = tail call align 4 i32* @unknown()
429 ; IS__CGSCC_NPM-NEXT: [[PTR2:%.*]] = tail call align 8 i32* @unknown()
430 ; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone [[PTR0]]) #[[ATTR3:[0-9]+]]
431 ; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]]
432 ; IS__CGSCC_NPM-NEXT: tail call void @test8(i32* noalias nocapture readnone align 8 [[PTR2]], i32* noalias nocapture readnone align 4 [[PTR1]], i32* noalias nocapture readnone align 4 [[PTR1]]) #[[ATTR3]]
433 ; IS__CGSCC_NPM-NEXT: ret void
435 %ptr0 = tail call i32* @unknown()
436 %ptr1 = tail call align 4 i32* @unknown()
437 %ptr2 = tail call align 8 i32* @unknown()
439 tail call void @test8(i32* %ptr1, i32* %ptr1, i32* %ptr0)
440 tail call void @test8(i32* %ptr2, i32* %ptr1, i32* %ptr1)
441 tail call void @test8(i32* %ptr2, i32* %ptr1, i32* %ptr1)
445 declare void @user_i32_ptr(i32* nocapture readnone) nounwind
446 define internal void @test8(i32* %a, i32* %b, i32* %c) {
447 ; IS__TUNIT____: Function Attrs: nounwind
448 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test8
449 ; IS__TUNIT____-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR2]] {
450 ; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR2]]
451 ; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR2]]
452 ; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR2]]
453 ; IS__TUNIT____-NEXT: ret void
455 ; IS__CGSCC_OPM: Function Attrs: nounwind
456 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test8
457 ; IS__CGSCC_OPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR4]] {
458 ; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR4]]
459 ; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR4]]
460 ; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR4]]
461 ; IS__CGSCC_OPM-NEXT: ret void
463 ; IS__CGSCC_NPM: Function Attrs: nounwind
464 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test8
465 ; IS__CGSCC_NPM-SAME: (i32* noalias nocapture readnone align 4 [[A:%.*]], i32* noalias nocapture readnone align 4 [[B:%.*]], i32* noalias nocapture readnone [[C:%.*]]) #[[ATTR3]] {
466 ; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[A]]) #[[ATTR3]]
467 ; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone align 4 [[B]]) #[[ATTR3]]
468 ; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture readnone [[C]]) #[[ATTR3]]
469 ; IS__CGSCC_NPM-NEXT: ret void
471 call void @user_i32_ptr(i32* %a)
472 call void @user_i32_ptr(i32* %b)
473 call void @user_i32_ptr(i32* %c)
477 declare void @test9_helper(i32* %A)
478 define void @test9_traversal(i1 %cnd, i32* align 4 %B, i32* align 8 %C) {
479 ; CHECK-LABEL: define {{[^@]+}}@test9_traversal
480 ; CHECK-SAME: (i1 [[CND:%.*]], i32* align 4 [[B:%.*]], i32* align 8 [[C:%.*]]) {
481 ; CHECK-NEXT: [[SEL:%.*]] = select i1 [[CND]], i32* [[B]], i32* [[C]]
482 ; CHECK-NEXT: call void @test9_helper(i32* align 4 [[SEL]])
483 ; CHECK-NEXT: ret void
485 %sel = select i1 %cnd, i32* %B, i32* %C
486 call void @test9_helper(i32* %sel)
490 ; FIXME: This will work with an upcoming patch (D66618 or similar)
491 ; define align 32 i32* @test10a(i32* align 32 "no-capture-maybe-returned" %p)
492 ; FIXME: This will work with an upcoming patch (D66618 or similar)
493 ; store i32 1, i32* %r, align 32
494 ; FIXME: This will work with an upcoming patch (D66618 or similar)
495 ; store i32 -1, i32* %g1, align 32
496 define i32* @test10a(i32* align 32 %p) {
497 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind
498 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test10a
499 ; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3:[0-9]+]] {
500 ; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32
501 ; IS__TUNIT____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0
502 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
504 ; IS__TUNIT____-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]]
505 ; IS__TUNIT____-NEXT: store i32 1, i32* [[R]], align 32
506 ; IS__TUNIT____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8
507 ; IS__TUNIT____-NEXT: br label [[E:%.*]]
509 ; IS__TUNIT____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8
510 ; IS__TUNIT____-NEXT: store i32 -1, i32* [[G1]], align 32
511 ; IS__TUNIT____-NEXT: br label [[E]]
513 ; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ]
514 ; IS__TUNIT____-NEXT: ret i32* [[PHI]]
516 ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind
517 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10a
518 ; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR5:[0-9]+]] {
519 ; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32
520 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0
521 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
523 ; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR5]]
524 ; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32
525 ; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8
526 ; IS__CGSCC_OPM-NEXT: br label [[E:%.*]]
528 ; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8
529 ; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32
530 ; IS__CGSCC_OPM-NEXT: br label [[E]]
532 ; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ]
533 ; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]]
535 ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind
536 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10a
537 ; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4:[0-9]+]] {
538 ; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32
539 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0
540 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
542 ; IS__CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10a(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]]
543 ; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32
544 ; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8
545 ; IS__CGSCC_NPM-NEXT: br label [[E:%.*]]
547 ; IS__CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 8
548 ; IS__CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32
549 ; IS__CGSCC_NPM-NEXT: br label [[E]]
551 ; IS__CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ]
552 ; IS__CGSCC_NPM-NEXT: ret i32* [[PHI]]
554 %l = load i32, i32* %p
555 %c = icmp eq i32 %l, 0
556 br i1 %c, label %t, label %f
558 %r = call i32* @test10a(i32* %p)
560 %g0 = getelementptr i32, i32* %p, i32 8
563 %g1 = getelementptr i32, i32* %p, i32 8
564 store i32 -1, i32* %g1
567 %phi = phi i32* [%g0, %t], [%g1, %f]
571 ; FIXME: This will work with an upcoming patch (D66618 or similar)
572 ; define align 32 i32* @test10b(i32* align 32 "no-capture-maybe-returned" %p)
573 ; FIXME: This will work with an upcoming patch (D66618 or similar)
574 ; store i32 1, i32* %r, align 32
575 ; FIXME: This will work with an upcoming patch (D66618 or similar)
576 ; store i32 -1, i32* %g1, align 32
577 define i32* @test10b(i32* align 32 %p) {
578 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind
579 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test10b
580 ; IS__TUNIT____-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] {
581 ; IS__TUNIT____-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32
582 ; IS__TUNIT____-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0
583 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
585 ; IS__TUNIT____-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR3]]
586 ; IS__TUNIT____-NEXT: store i32 1, i32* [[R]], align 32
587 ; IS__TUNIT____-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8
588 ; IS__TUNIT____-NEXT: br label [[E:%.*]]
590 ; IS__TUNIT____-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8
591 ; IS__TUNIT____-NEXT: store i32 -1, i32* [[G1]], align 32
592 ; IS__TUNIT____-NEXT: br label [[E]]
594 ; IS__TUNIT____-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ]
595 ; IS__TUNIT____-NEXT: ret i32* [[PHI]]
597 ; IS__CGSCC_OPM: Function Attrs: nofree nosync nounwind
598 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test10b
599 ; IS__CGSCC_OPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR5]] {
600 ; IS__CGSCC_OPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32
601 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0
602 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
604 ; IS__CGSCC_OPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR5]]
605 ; IS__CGSCC_OPM-NEXT: store i32 1, i32* [[R]], align 32
606 ; IS__CGSCC_OPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8
607 ; IS__CGSCC_OPM-NEXT: br label [[E:%.*]]
609 ; IS__CGSCC_OPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8
610 ; IS__CGSCC_OPM-NEXT: store i32 -1, i32* [[G1]], align 32
611 ; IS__CGSCC_OPM-NEXT: br label [[E]]
613 ; IS__CGSCC_OPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ]
614 ; IS__CGSCC_OPM-NEXT: ret i32* [[PHI]]
616 ; IS__CGSCC_NPM: Function Attrs: nofree nosync nounwind
617 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test10b
618 ; IS__CGSCC_NPM-SAME: (i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] {
619 ; IS__CGSCC_NPM-NEXT: [[L:%.*]] = load i32, i32* [[P]], align 32
620 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = icmp eq i32 [[L]], 0
621 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[T:%.*]], label [[F:%.*]]
623 ; IS__CGSCC_NPM-NEXT: [[R:%.*]] = call align 32 i32* @test10b(i32* nofree noundef nonnull align 32 dereferenceable(4) "no-capture-maybe-returned" [[P]]) #[[ATTR4]]
624 ; IS__CGSCC_NPM-NEXT: store i32 1, i32* [[R]], align 32
625 ; IS__CGSCC_NPM-NEXT: [[G0:%.*]] = getelementptr i32, i32* [[P]], i32 8
626 ; IS__CGSCC_NPM-NEXT: br label [[E:%.*]]
628 ; IS__CGSCC_NPM-NEXT: [[G1:%.*]] = getelementptr i32, i32* [[P]], i32 -8
629 ; IS__CGSCC_NPM-NEXT: store i32 -1, i32* [[G1]], align 32
630 ; IS__CGSCC_NPM-NEXT: br label [[E]]
632 ; IS__CGSCC_NPM-NEXT: [[PHI:%.*]] = phi i32* [ [[G0]], [[T]] ], [ [[G1]], [[F]] ]
633 ; IS__CGSCC_NPM-NEXT: ret i32* [[PHI]]
635 %l = load i32, i32* %p
636 %c = icmp eq i32 %l, 0
637 br i1 %c, label %t, label %f
639 %r = call i32* @test10b(i32* %p)
641 %g0 = getelementptr i32, i32* %p, i32 8
644 %g1 = getelementptr i32, i32* %p, i32 -8
645 store i32 -1, i32* %g1
648 %phi = phi i32* [%g0, %t], [%g1, %f]
653 define i64 @test11(i32* %p) {
654 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn
655 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test11
656 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR4:[0-9]+]] {
657 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
658 ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8
659 ; IS__TUNIT____-NEXT: ret i64 [[RET]]
661 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
662 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test11
663 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR6:[0-9]+]] {
664 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
665 ; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8
666 ; IS__CGSCC_OPM-NEXT: ret i64 [[RET]]
668 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
669 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test11
670 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 8 dereferenceable(8) [[P:%.*]]) #[[ATTR5:[0-9]+]] {
671 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
672 ; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[P_CAST]], align 8
673 ; IS__CGSCC_NPM-NEXT: ret i64 [[RET]]
675 %p-cast = bitcast i32* %p to i64*
676 %ret = load i64, i64* %p-cast, align 8
681 ; Test for deduction using must-be-executed-context and GEP instruction
683 ; FXIME: %p should have nonnull
684 define i64 @test12-1(i32* align 4 %p) {
685 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn
686 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-1
687 ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR4]] {
688 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
689 ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
690 ; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
691 ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16
692 ; IS__TUNIT____-NEXT: ret i64 [[RET]]
694 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
695 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-1
696 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR6]] {
697 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
698 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
699 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
700 ; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16
701 ; IS__CGSCC_OPM-NEXT: ret i64 [[RET]]
703 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
704 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-1
705 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly align 16 [[P:%.*]]) #[[ATTR5]] {
706 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
707 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
708 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
709 ; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX1]], align 16
710 ; IS__CGSCC_NPM-NEXT: ret i64 [[RET]]
712 %p-cast = bitcast i32* %p to i64*
713 %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1
714 %arrayidx1 = getelementptr i64, i64* %arrayidx0, i64 3
715 %ret = load i64, i64* %arrayidx1, align 16
719 define i64 @test12-2(i32* align 4 %p) {
720 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn
721 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-2
722 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR4]] {
723 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
724 ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
725 ; IS__TUNIT____-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16
726 ; IS__TUNIT____-NEXT: ret i64 [[RET]]
728 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
729 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-2
730 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] {
731 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
732 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
733 ; IS__CGSCC_OPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16
734 ; IS__CGSCC_OPM-NEXT: ret i64 [[RET]]
736 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
737 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-2
738 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull readonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] {
739 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
740 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
741 ; IS__CGSCC_NPM-NEXT: [[RET:%.*]] = load i64, i64* [[ARRAYIDX0]], align 16
742 ; IS__CGSCC_NPM-NEXT: ret i64 [[RET]]
744 %p-cast = bitcast i32* %p to i64*
745 %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0
746 %ret = load i64, i64* %arrayidx0, align 16
750 ; FXIME: %p should have nonnull
751 define void @test12-3(i32* align 4 %p) {
752 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
753 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-3
754 ; IS__TUNIT____-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR5:[0-9]+]] {
755 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
756 ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
757 ; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
758 ; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16
759 ; IS__TUNIT____-NEXT: ret void
761 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
762 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-3
763 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] {
764 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
765 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
766 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
767 ; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16
768 ; IS__CGSCC_OPM-NEXT: ret void
770 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
771 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-3
772 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree writeonly align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] {
773 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
774 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
775 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
776 ; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX1]], align 16
777 ; IS__CGSCC_NPM-NEXT: ret void
779 %p-cast = bitcast i32* %p to i64*
780 %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1
781 %arrayidx1 = getelementptr i64, i64* %arrayidx0, i64 3
782 store i64 0, i64* %arrayidx1, align 16
786 define void @test12-4(i32* align 4 %p) {
787 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
788 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-4
789 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR5]] {
790 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
791 ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
792 ; IS__TUNIT____-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16
793 ; IS__TUNIT____-NEXT: ret void
795 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
796 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-4
797 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR7]] {
798 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
799 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
800 ; IS__CGSCC_OPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16
801 ; IS__CGSCC_OPM-NEXT: ret void
803 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
804 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-4
805 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 16 dereferenceable(8) [[P:%.*]]) #[[ATTR6]] {
806 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
807 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
808 ; IS__CGSCC_NPM-NEXT: store i64 0, i64* [[ARRAYIDX0]], align 16
809 ; IS__CGSCC_NPM-NEXT: ret void
811 %p-cast = bitcast i32* %p to i64*
812 %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0
813 store i64 0, i64* %arrayidx0, align 16
817 declare void @use(i64*) willreturn nounwind
819 define void @test12-5(i32* align 4 %p) {
820 ; IS__TUNIT____: Function Attrs: nounwind willreturn
821 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-5
822 ; IS__TUNIT____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6:[0-9]+]] {
823 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
824 ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
825 ; IS__TUNIT____-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
826 ; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR6]]
827 ; IS__TUNIT____-NEXT: ret void
829 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
830 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-5
831 ; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR8:[0-9]+]] {
832 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
833 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
834 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
835 ; IS__CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR8]]
836 ; IS__CGSCC_OPM-NEXT: ret void
838 ; IS__CGSCC_NPM: Function Attrs: nounwind willreturn
839 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-5
840 ; IS__CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7:[0-9]+]] {
841 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
842 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 1
843 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX1:%.*]] = getelementptr i64, i64* [[ARRAYIDX0]], i64 3
844 ; IS__CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX1]]) #[[ATTR7]]
845 ; IS__CGSCC_NPM-NEXT: ret void
847 %p-cast = bitcast i32* %p to i64*
848 %arrayidx0 = getelementptr i64, i64* %p-cast, i64 1
849 %arrayidx1 = getelementptr i64, i64* %arrayidx0, i64 3
850 tail call void @use(i64* align 16 %arrayidx1)
854 define void @test12-6(i32* align 4 %p) {
855 ; IS__TUNIT____: Function Attrs: nounwind willreturn
856 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test12-6
857 ; IS__TUNIT____-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR6]] {
858 ; IS__TUNIT____-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
859 ; IS__TUNIT____-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
860 ; IS__TUNIT____-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR6]]
861 ; IS__TUNIT____-NEXT: ret void
863 ; IS__CGSCC_OPM: Function Attrs: nounwind willreturn
864 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test12-6
865 ; IS__CGSCC_OPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR8]] {
866 ; IS__CGSCC_OPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
867 ; IS__CGSCC_OPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
868 ; IS__CGSCC_OPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR8]]
869 ; IS__CGSCC_OPM-NEXT: ret void
871 ; IS__CGSCC_NPM: Function Attrs: nounwind willreturn
872 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test12-6
873 ; IS__CGSCC_NPM-SAME: (i32* align 16 [[P:%.*]]) #[[ATTR7]] {
874 ; IS__CGSCC_NPM-NEXT: [[P_CAST:%.*]] = bitcast i32* [[P]] to i64*
875 ; IS__CGSCC_NPM-NEXT: [[ARRAYIDX0:%.*]] = getelementptr i64, i64* [[P_CAST]], i64 0
876 ; IS__CGSCC_NPM-NEXT: tail call void @use(i64* align 16 [[ARRAYIDX0]]) #[[ATTR7]]
877 ; IS__CGSCC_NPM-NEXT: ret void
879 %p-cast = bitcast i32* %p to i64*
880 %arrayidx0 = getelementptr i64, i64* %p-cast, i64 0
881 tail call void @use(i64* align 16 %arrayidx0)
885 define void @test13(i1 %c, i32* align 32 %dst) #0 {
886 ; IS__TUNIT____: Function Attrs: argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly
887 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13
888 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR7:[0-9]+]] {
889 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
890 ; IS__TUNIT____: truebb:
891 ; IS__TUNIT____-NEXT: br label [[END:%.*]]
892 ; IS__TUNIT____: falsebb:
893 ; IS__TUNIT____-NEXT: br label [[END]]
894 ; IS__TUNIT____: end:
895 ; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ]
896 ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32
897 ; IS__TUNIT____-NEXT: ret void
899 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly
900 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13
901 ; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] {
902 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
903 ; IS__CGSCC_OPM: truebb:
904 ; IS__CGSCC_OPM-NEXT: br label [[END:%.*]]
905 ; IS__CGSCC_OPM: falsebb:
906 ; IS__CGSCC_OPM-NEXT: br label [[END]]
907 ; IS__CGSCC_OPM: end:
908 ; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ]
909 ; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32
910 ; IS__CGSCC_OPM-NEXT: ret void
912 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly
913 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13
914 ; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] {
915 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
916 ; IS__CGSCC_NPM: truebb:
917 ; IS__CGSCC_NPM-NEXT: br label [[END:%.*]]
918 ; IS__CGSCC_NPM: falsebb:
919 ; IS__CGSCC_NPM-NEXT: br label [[END]]
920 ; IS__CGSCC_NPM: end:
921 ; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ null, [[FALSEBB]] ]
922 ; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32
923 ; IS__CGSCC_NPM-NEXT: ret void
925 br i1 %c, label %truebb, label %falsebb
931 %ptr = phi i32* [ %dst, %truebb ], [ null, %falsebb ]
932 store i32 0, i32* %ptr
936 define void @test13-1(i1 %c, i32* align 32 %dst) {
937 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly
938 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-1
939 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8:[0-9]+]] {
940 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
941 ; IS__TUNIT____: truebb:
942 ; IS__TUNIT____-NEXT: br label [[END:%.*]]
943 ; IS__TUNIT____: falsebb:
944 ; IS__TUNIT____-NEXT: br label [[END]]
945 ; IS__TUNIT____: end:
946 ; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ]
947 ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 16
948 ; IS__TUNIT____-NEXT: ret void
950 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
951 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-1
952 ; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10:[0-9]+]] {
953 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
954 ; IS__CGSCC_OPM: truebb:
955 ; IS__CGSCC_OPM-NEXT: br label [[END:%.*]]
956 ; IS__CGSCC_OPM: falsebb:
957 ; IS__CGSCC_OPM-NEXT: br label [[END]]
958 ; IS__CGSCC_OPM: end:
959 ; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ]
960 ; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 16
961 ; IS__CGSCC_OPM-NEXT: ret void
963 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
964 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-1
965 ; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9:[0-9]+]] {
966 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
967 ; IS__CGSCC_NPM: truebb:
968 ; IS__CGSCC_NPM-NEXT: br label [[END:%.*]]
969 ; IS__CGSCC_NPM: falsebb:
970 ; IS__CGSCC_NPM-NEXT: br label [[END]]
971 ; IS__CGSCC_NPM: end:
972 ; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 48 to i32*), [[FALSEBB]] ]
973 ; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 16
974 ; IS__CGSCC_NPM-NEXT: ret void
976 br i1 %c, label %truebb, label %falsebb
982 %ptr = phi i32* [ %dst, %truebb ], [ inttoptr (i64 48 to i32*), %falsebb ]
983 store i32 0, i32* %ptr
987 define void @test13-2(i1 %c, i32* align 32 %dst) {
988 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly
989 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-2
990 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] {
991 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
992 ; IS__TUNIT____: truebb:
993 ; IS__TUNIT____-NEXT: br label [[END:%.*]]
994 ; IS__TUNIT____: falsebb:
995 ; IS__TUNIT____-NEXT: br label [[END]]
996 ; IS__TUNIT____: end:
997 ; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ]
998 ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32
999 ; IS__TUNIT____-NEXT: ret void
1001 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1002 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-2
1003 ; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10]] {
1004 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
1005 ; IS__CGSCC_OPM: truebb:
1006 ; IS__CGSCC_OPM-NEXT: br label [[END:%.*]]
1007 ; IS__CGSCC_OPM: falsebb:
1008 ; IS__CGSCC_OPM-NEXT: br label [[END]]
1009 ; IS__CGSCC_OPM: end:
1010 ; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ]
1011 ; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32
1012 ; IS__CGSCC_OPM-NEXT: ret void
1014 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1015 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-2
1016 ; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] {
1017 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
1018 ; IS__CGSCC_NPM: truebb:
1019 ; IS__CGSCC_NPM-NEXT: br label [[END:%.*]]
1020 ; IS__CGSCC_NPM: falsebb:
1021 ; IS__CGSCC_NPM-NEXT: br label [[END]]
1022 ; IS__CGSCC_NPM: end:
1023 ; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 160 to i32*), [[FALSEBB]] ]
1024 ; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32
1025 ; IS__CGSCC_NPM-NEXT: ret void
1027 br i1 %c, label %truebb, label %falsebb
1033 %ptr = phi i32* [ %dst, %truebb ], [ inttoptr (i64 160 to i32*), %falsebb ]
1034 store i32 0, i32* %ptr
1038 define void @test13-3(i1 %c, i32* align 32 %dst) {
1039 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind willreturn writeonly
1040 ; IS__TUNIT____-LABEL: define {{[^@]+}}@test13-3
1041 ; IS__TUNIT____-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR8]] {
1042 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
1043 ; IS__TUNIT____: truebb:
1044 ; IS__TUNIT____-NEXT: br label [[END:%.*]]
1045 ; IS__TUNIT____: falsebb:
1046 ; IS__TUNIT____-NEXT: br label [[END]]
1047 ; IS__TUNIT____: end:
1048 ; IS__TUNIT____-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ]
1049 ; IS__TUNIT____-NEXT: store i32 0, i32* [[PTR]], align 32
1050 ; IS__TUNIT____-NEXT: ret void
1052 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1053 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@test13-3
1054 ; IS__CGSCC_OPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR10]] {
1055 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
1056 ; IS__CGSCC_OPM: truebb:
1057 ; IS__CGSCC_OPM-NEXT: br label [[END:%.*]]
1058 ; IS__CGSCC_OPM: falsebb:
1059 ; IS__CGSCC_OPM-NEXT: br label [[END]]
1060 ; IS__CGSCC_OPM: end:
1061 ; IS__CGSCC_OPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ]
1062 ; IS__CGSCC_OPM-NEXT: store i32 0, i32* [[PTR]], align 32
1063 ; IS__CGSCC_OPM-NEXT: ret void
1065 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind willreturn writeonly
1066 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@test13-3
1067 ; IS__CGSCC_NPM-SAME: (i1 [[C:%.*]], i32* nocapture nofree writeonly align 32 [[DST:%.*]]) #[[ATTR9]] {
1068 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[TRUEBB:%.*]], label [[FALSEBB:%.*]]
1069 ; IS__CGSCC_NPM: truebb:
1070 ; IS__CGSCC_NPM-NEXT: br label [[END:%.*]]
1071 ; IS__CGSCC_NPM: falsebb:
1072 ; IS__CGSCC_NPM-NEXT: br label [[END]]
1073 ; IS__CGSCC_NPM: end:
1074 ; IS__CGSCC_NPM-NEXT: [[PTR:%.*]] = phi i32* [ [[DST]], [[TRUEBB]] ], [ inttoptr (i64 128 to i32*), [[FALSEBB]] ]
1075 ; IS__CGSCC_NPM-NEXT: store i32 0, i32* [[PTR]], align 32
1076 ; IS__CGSCC_NPM-NEXT: ret void
1078 br i1 %c, label %truebb, label %falsebb
1084 %ptr = phi i32* [ %dst, %truebb ], [ inttoptr (i64 128 to i32*), %falsebb ]
1085 store i32 0, i32* %ptr
1089 ; Don't crash on ptr2int/int2ptr uses.
1090 define i64 @ptr2int(i32* %p) {
1091 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
1092 ; IS__TUNIT____-LABEL: define {{[^@]+}}@ptr2int
1093 ; IS__TUNIT____-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR9:[0-9]+]] {
1094 ; IS__TUNIT____-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64
1095 ; IS__TUNIT____-NEXT: ret i64 [[P2I]]
1097 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1098 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@ptr2int
1099 ; IS__CGSCC_OPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR11:[0-9]+]] {
1100 ; IS__CGSCC_OPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64
1101 ; IS__CGSCC_OPM-NEXT: ret i64 [[P2I]]
1103 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1104 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@ptr2int
1105 ; IS__CGSCC_NPM-SAME: (i32* nofree readnone [[P:%.*]]) #[[ATTR10:[0-9]+]] {
1106 ; IS__CGSCC_NPM-NEXT: [[P2I:%.*]] = ptrtoint i32* [[P]] to i64
1107 ; IS__CGSCC_NPM-NEXT: ret i64 [[P2I]]
1109 %p2i = ptrtoint i32* %p to i64
1112 define i64* @int2ptr(i64 %i) {
1113 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readnone willreturn
1114 ; IS__TUNIT____-LABEL: define {{[^@]+}}@int2ptr
1115 ; IS__TUNIT____-SAME: (i64 [[I:%.*]]) #[[ATTR9]] {
1116 ; IS__TUNIT____-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64*
1117 ; IS__TUNIT____-NEXT: ret i64* [[I2P]]
1119 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1120 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@int2ptr
1121 ; IS__CGSCC_OPM-SAME: (i64 [[I:%.*]]) #[[ATTR11]] {
1122 ; IS__CGSCC_OPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64*
1123 ; IS__CGSCC_OPM-NEXT: ret i64* [[I2P]]
1125 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readnone willreturn
1126 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@int2ptr
1127 ; IS__CGSCC_NPM-SAME: (i64 [[I:%.*]]) #[[ATTR10]] {
1128 ; IS__CGSCC_NPM-NEXT: [[I2P:%.*]] = inttoptr i64 [[I]] to i64*
1129 ; IS__CGSCC_NPM-NEXT: ret i64* [[I2P]]
1131 %i2p = inttoptr i64 %i to i64*
1135 ; Use the store alignment only for the pointer operand.
1136 define void @aligned_store(i8* %Value, i8** %Ptr) {
1137 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
1138 ; IS__TUNIT____-LABEL: define {{[^@]+}}@aligned_store
1139 ; IS__TUNIT____-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR5]] {
1140 ; IS__TUNIT____-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32
1141 ; IS__TUNIT____-NEXT: ret void
1143 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1144 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@aligned_store
1145 ; IS__CGSCC_OPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR7]] {
1146 ; IS__CGSCC_OPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32
1147 ; IS__CGSCC_OPM-NEXT: ret void
1149 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1150 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@aligned_store
1151 ; IS__CGSCC_NPM-SAME: (i8* nofree writeonly [[VALUE:%.*]], i8** nocapture nofree noundef nonnull writeonly align 32 dereferenceable(8) [[PTR:%.*]]) #[[ATTR6]] {
1152 ; IS__CGSCC_NPM-NEXT: store i8* [[VALUE]], i8** [[PTR]], align 32
1153 ; IS__CGSCC_NPM-NEXT: ret void
1155 store i8* %Value, i8** %Ptr, align 32
1159 declare i8* @some_func(i8*)
1160 define void @align_call_op_not_store(i8* align 2048 %arg) {
1161 ; CHECK-LABEL: define {{[^@]+}}@align_call_op_not_store
1162 ; CHECK-SAME: (i8* align 2048 [[ARG:%.*]]) {
1163 ; CHECK-NEXT: [[UNKNOWN:%.*]] = call i8* @some_func(i8* align 2048 [[ARG]])
1164 ; CHECK-NEXT: store i8 0, i8* [[UNKNOWN]], align 1
1165 ; CHECK-NEXT: ret void
1167 %unknown = call i8* @some_func(i8* %arg)
1168 store i8 0, i8* %unknown
1171 define void @align_store_after_bc(i32* align 2048 %arg) {
1173 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind willreturn writeonly
1174 ; IS__TUNIT____-LABEL: define {{[^@]+}}@align_store_after_bc
1175 ; IS__TUNIT____-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR5]] {
1176 ; IS__TUNIT____-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8*
1177 ; IS__TUNIT____-NEXT: store i8 0, i8* [[BC]], align 2048
1178 ; IS__TUNIT____-NEXT: ret void
1180 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1181 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@align_store_after_bc
1182 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR7]] {
1183 ; IS__CGSCC_OPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8*
1184 ; IS__CGSCC_OPM-NEXT: store i8 0, i8* [[BC]], align 2048
1185 ; IS__CGSCC_OPM-NEXT: ret void
1187 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind willreturn writeonly
1188 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@align_store_after_bc
1189 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree nonnull writeonly align 2048 dereferenceable(1) [[ARG:%.*]]) #[[ATTR6]] {
1190 ; IS__CGSCC_NPM-NEXT: [[BC:%.*]] = bitcast i32* [[ARG]] to i8*
1191 ; IS__CGSCC_NPM-NEXT: store i8 0, i8* [[BC]], align 2048
1192 ; IS__CGSCC_NPM-NEXT: ret void
1194 %bc = bitcast i32* %arg to i8*
1199 ; Make sure we do not annotate the callee of a must-tail call with an alignment
1200 ; we cannot also put on the caller.
1201 @cnd = external global i1
1202 define i32 @musttail_callee_1(i32* %p) {
1203 ; IS__TUNIT____: Function Attrs: argmemonly nofree nosync nounwind readonly willreturn
1204 ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_callee_1
1205 ; IS__TUNIT____-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR4]] {
1206 ; IS__TUNIT____-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32
1207 ; IS__TUNIT____-NEXT: ret i32 [[V]]
1209 ; IS__CGSCC_OPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1210 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_callee_1
1211 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR6]] {
1212 ; IS__CGSCC_OPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32
1213 ; IS__CGSCC_OPM-NEXT: ret i32 [[V]]
1215 ; IS__CGSCC_NPM: Function Attrs: argmemonly nofree norecurse nosync nounwind readonly willreturn
1216 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_callee_1
1217 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P:%.*]]) #[[ATTR5]] {
1218 ; IS__CGSCC_NPM-NEXT: [[V:%.*]] = load i32, i32* [[P]], align 32
1219 ; IS__CGSCC_NPM-NEXT: ret i32 [[V]]
1221 %v = load i32, i32* %p, align 32
1224 define i32 @musttail_caller_1(i32* %p) {
1225 ; IS__TUNIT____: Function Attrs: nofree nosync nounwind readonly willreturn
1226 ; IS__TUNIT____-LABEL: define {{[^@]+}}@musttail_caller_1
1227 ; IS__TUNIT____-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR10:[0-9]+]] {
1228 ; IS__TUNIT____-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1
1229 ; IS__TUNIT____-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]]
1230 ; IS__TUNIT____: mt:
1231 ; IS__TUNIT____-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree readonly [[P]]) #[[ATTR10]]
1232 ; IS__TUNIT____-NEXT: ret i32 [[V]]
1233 ; IS__TUNIT____: exit:
1234 ; IS__TUNIT____-NEXT: ret i32 0
1236 ; IS__CGSCC_OPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
1237 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@musttail_caller_1
1238 ; IS__CGSCC_OPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR12:[0-9]+]] {
1239 ; IS__CGSCC_OPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1
1240 ; IS__CGSCC_OPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]]
1241 ; IS__CGSCC_OPM: mt:
1242 ; IS__CGSCC_OPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR13:[0-9]+]]
1243 ; IS__CGSCC_OPM-NEXT: ret i32 [[V]]
1244 ; IS__CGSCC_OPM: exit:
1245 ; IS__CGSCC_OPM-NEXT: ret i32 0
1247 ; IS__CGSCC_NPM: Function Attrs: nofree norecurse nosync nounwind readonly willreturn
1248 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@musttail_caller_1
1249 ; IS__CGSCC_NPM-SAME: (i32* nocapture nofree readonly [[P:%.*]]) #[[ATTR11:[0-9]+]] {
1250 ; IS__CGSCC_NPM-NEXT: [[C:%.*]] = load i1, i1* @cnd, align 1
1251 ; IS__CGSCC_NPM-NEXT: br i1 [[C]], label [[MT:%.*]], label [[EXIT:%.*]]
1252 ; IS__CGSCC_NPM: mt:
1253 ; IS__CGSCC_NPM-NEXT: [[V:%.*]] = musttail call i32 @musttail_callee_1(i32* nocapture nofree noundef nonnull readonly dereferenceable(4) [[P]]) #[[ATTR12:[0-9]+]]
1254 ; IS__CGSCC_NPM-NEXT: ret i32 [[V]]
1255 ; IS__CGSCC_NPM: exit:
1256 ; IS__CGSCC_NPM-NEXT: ret i32 0
1258 %c = load i1, i1* @cnd
1259 br i1 %c, label %mt, label %exit
1261 %v = musttail call i32 @musttail_callee_1(i32* %p)
1267 define i32* @checkAndAdvance(i32* align(16) %p) {
1268 ; IS__TUNIT____: Function Attrs: nounwind
1269 ; IS__TUNIT____-LABEL: define {{[^@]+}}@checkAndAdvance
1270 ; IS__TUNIT____-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR2]] {
1271 ; IS__TUNIT____-NEXT: entry:
1272 ; IS__TUNIT____-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16
1273 ; IS__TUNIT____-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0
1274 ; IS__TUNIT____-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]]
1275 ; IS__TUNIT____: if.then:
1276 ; IS__TUNIT____-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4
1277 ; IS__TUNIT____-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR2]]
1278 ; IS__TUNIT____-NEXT: br label [[RETURN]]
1279 ; IS__TUNIT____: return:
1280 ; IS__TUNIT____-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ]
1281 ; IS__TUNIT____-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR2]]
1282 ; IS__TUNIT____-NEXT: ret i32* [[RETVAL_0]]
1284 ; IS__CGSCC_OPM: Function Attrs: nounwind
1285 ; IS__CGSCC_OPM-LABEL: define {{[^@]+}}@checkAndAdvance
1286 ; IS__CGSCC_OPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR4]] {
1287 ; IS__CGSCC_OPM-NEXT: entry:
1288 ; IS__CGSCC_OPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16
1289 ; IS__CGSCC_OPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0
1290 ; IS__CGSCC_OPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]]
1291 ; IS__CGSCC_OPM: if.then:
1292 ; IS__CGSCC_OPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4
1293 ; IS__CGSCC_OPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR4]]
1294 ; IS__CGSCC_OPM-NEXT: br label [[RETURN]]
1295 ; IS__CGSCC_OPM: return:
1296 ; IS__CGSCC_OPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ]
1297 ; IS__CGSCC_OPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR4]]
1298 ; IS__CGSCC_OPM-NEXT: ret i32* [[RETVAL_0]]
1300 ; IS__CGSCC_NPM: Function Attrs: nounwind
1301 ; IS__CGSCC_NPM-LABEL: define {{[^@]+}}@checkAndAdvance
1302 ; IS__CGSCC_NPM-SAME: (i32* noundef nonnull readonly align 16 dereferenceable(4) "no-capture-maybe-returned" [[P:%.*]]) #[[ATTR3]] {
1303 ; IS__CGSCC_NPM-NEXT: entry:
1304 ; IS__CGSCC_NPM-NEXT: [[TMP0:%.*]] = load i32, i32* [[P]], align 16
1305 ; IS__CGSCC_NPM-NEXT: [[CMP:%.*]] = icmp eq i32 [[TMP0]], 0
1306 ; IS__CGSCC_NPM-NEXT: br i1 [[CMP]], label [[IF_THEN:%.*]], label [[RETURN:%.*]]
1307 ; IS__CGSCC_NPM: if.then:
1308 ; IS__CGSCC_NPM-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, i32* [[P]], i64 4
1309 ; IS__CGSCC_NPM-NEXT: [[CALL:%.*]] = call nonnull align 16 i32* @checkAndAdvance(i32* nonnull readonly align 16 "no-capture-maybe-returned" [[ADD_PTR]]) #[[ATTR3]]
1310 ; IS__CGSCC_NPM-NEXT: br label [[RETURN]]
1311 ; IS__CGSCC_NPM: return:
1312 ; IS__CGSCC_NPM-NEXT: [[RETVAL_0:%.*]] = phi i32* [ [[CALL]], [[IF_THEN]] ], [ [[P]], [[ENTRY:%.*]] ]
1313 ; IS__CGSCC_NPM-NEXT: call void @user_i32_ptr(i32* noalias nocapture nonnull readnone align 16 [[RETVAL_0]]) #[[ATTR3]]
1314 ; IS__CGSCC_NPM-NEXT: ret i32* [[RETVAL_0]]
1317 %0 = load i32, i32* %p, align 4
1318 %cmp = icmp eq i32 %0, 0
1319 br i1 %cmp, label %if.then, label %return
1321 if.then: ; preds = %entry
1322 %add.ptr = getelementptr inbounds i32, i32* %p, i64 4
1323 %call = call i32* @checkAndAdvance(i32* nonnull %add.ptr)
1326 return: ; preds = %entry, %if.then
1327 %retval.0 = phi i32* [ %call, %if.then ], [ %p, %entry ]
1328 call void @user_i32_ptr(i32* %retval.0)
1332 ; FIXME: align 4 should not be propagated to the caller's p unless there is noundef
1333 define void @align4_caller(i8* %p) {
1334 ; CHECK-LABEL: define {{[^@]+}}@align4_caller
1335 ; CHECK-SAME: (i8* align 4 [[P:%.*]]) {
1336 ; CHECK-NEXT: call void @align4_callee(i8* align 4 [[P]])
1337 ; CHECK-NEXT: ret void
1339 call void @align4_callee(i8* %p)
1343 declare void @align4_callee(i8* align(4) %p)
1346 attributes #0 = { nounwind uwtable noinline }
1347 attributes #1 = { uwtable noinline }
1348 attributes #2 = { null_pointer_is_valid }
1350 ; IS__TUNIT____: attributes #[[ATTR0]] = { nofree noinline nosync nounwind readnone uwtable willreturn }
1351 ; IS__TUNIT____: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn }
1352 ; IS__TUNIT____: attributes #[[ATTR2]] = { nounwind }
1353 ; IS__TUNIT____: attributes #[[ATTR3]] = { nofree nosync nounwind }
1354 ; IS__TUNIT____: attributes #[[ATTR4]] = { argmemonly nofree nosync nounwind readonly willreturn }
1355 ; IS__TUNIT____: attributes #[[ATTR5]] = { argmemonly nofree nosync nounwind willreturn writeonly }
1356 ; IS__TUNIT____: attributes #[[ATTR6]] = { nounwind willreturn }
1357 ; IS__TUNIT____: attributes #[[ATTR7]] = { argmemonly nofree noinline nosync nounwind uwtable willreturn writeonly }
1358 ; IS__TUNIT____: attributes #[[ATTR8]] = { nofree nosync nounwind willreturn writeonly }
1359 ; IS__TUNIT____: attributes #[[ATTR9]] = { nofree nosync nounwind readnone willreturn }
1360 ; IS__TUNIT____: attributes #[[ATTR10]] = { nofree nosync nounwind readonly willreturn }
1362 ; IS__CGSCC_OPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn }
1363 ; IS__CGSCC_OPM: attributes #[[ATTR1]] = { nofree noinline noreturn nosync nounwind readnone uwtable willreturn }
1364 ; IS__CGSCC_OPM: attributes #[[ATTR2]] = { nofree noinline nosync nounwind readnone uwtable willreturn }
1365 ; IS__CGSCC_OPM: attributes #[[ATTR3]] = { noinline nounwind uwtable }
1366 ; IS__CGSCC_OPM: attributes #[[ATTR4]] = { nounwind }
1367 ; IS__CGSCC_OPM: attributes #[[ATTR5]] = { nofree nosync nounwind }
1368 ; IS__CGSCC_OPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1369 ; IS__CGSCC_OPM: attributes #[[ATTR7]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1370 ; IS__CGSCC_OPM: attributes #[[ATTR8]] = { nounwind willreturn }
1371 ; IS__CGSCC_OPM: attributes #[[ATTR9]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly }
1372 ; IS__CGSCC_OPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind willreturn writeonly }
1373 ; IS__CGSCC_OPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readnone willreturn }
1374 ; IS__CGSCC_OPM: attributes #[[ATTR12]] = { nofree norecurse nosync nounwind readonly willreturn }
1375 ; IS__CGSCC_OPM: attributes #[[ATTR13]] = { readonly willreturn }
1377 ; IS__CGSCC_NPM: attributes #[[ATTR0]] = { nofree noinline norecurse nosync nounwind readnone uwtable willreturn }
1378 ; IS__CGSCC_NPM: attributes #[[ATTR1]] = { nofree noinline norecurse noreturn nosync nounwind readnone uwtable willreturn }
1379 ; IS__CGSCC_NPM: attributes #[[ATTR2]] = { noinline nounwind uwtable }
1380 ; IS__CGSCC_NPM: attributes #[[ATTR3]] = { nounwind }
1381 ; IS__CGSCC_NPM: attributes #[[ATTR4]] = { nofree nosync nounwind }
1382 ; IS__CGSCC_NPM: attributes #[[ATTR5]] = { argmemonly nofree norecurse nosync nounwind readonly willreturn }
1383 ; IS__CGSCC_NPM: attributes #[[ATTR6]] = { argmemonly nofree norecurse nosync nounwind willreturn writeonly }
1384 ; IS__CGSCC_NPM: attributes #[[ATTR7]] = { nounwind willreturn }
1385 ; IS__CGSCC_NPM: attributes #[[ATTR8]] = { argmemonly nofree noinline norecurse nosync nounwind uwtable willreturn writeonly }
1386 ; IS__CGSCC_NPM: attributes #[[ATTR9]] = { nofree norecurse nosync nounwind willreturn writeonly }
1387 ; IS__CGSCC_NPM: attributes #[[ATTR10]] = { nofree norecurse nosync nounwind readnone willreturn }
1388 ; IS__CGSCC_NPM: attributes #[[ATTR11]] = { nofree norecurse nosync nounwind readonly willreturn }
1389 ; IS__CGSCC_NPM: attributes #[[ATTR12]] = { readonly willreturn }