Lines Matching refs:nonnull

2 ; RUN: opt -S -function-attrs -enable-nonnull-arg-prop %s | FileCheck %s --check-prefixes=FNATTR
3 ; RUN: opt -S -passes=function-attrs -enable-nonnull-arg-prop %s | FileCheck %s --check-prefixes=FN…
7 declare nonnull i8* @ret_nonnull()
9 ; Return a pointer trivially nonnull (call return attribute)
11 ; FNATTR: define nonnull i8* @test1
16 ; Return a pointer trivially nonnull (argument attribute)
17 define i8* @test2(i8* nonnull %p) {
18 ; FNATTR: define nonnull i8* @test2
22 ; Given an SCC where one of the functions can not be marked nonnull,
23 ; can we still mark the other one which is trivially nonnull
35 ; FNATTR: define nonnull i8* @test3
42 ; nonnull if neither can ever return null. (In this case, they
45 ; FNATTR: define noalias nonnull i8* @test4_helper
51 ; FNATTR: define noalias nonnull i8* @test4
57 ; make sure we haven't marked them as nonnull.
103 ; FNATTR: define nonnull i8* @test8
117 ; FIXME: missing nonnull
127 ; return p? p: nonnull();
130 ; FIXME: missing nonnull
147 define void @test12(i8* nonnull %a) {
166 declare nonnull i8* @nonnull()
170 ; Argument of f1, f2, f3 can be marked with nonnull.
173 ; 1. In f1:bb6, %arg can be marked with nonnull because of the comparison in bb1
174 ; 2. Because f2 is internal function, f2(i32* %arg) -> @f2(i32* nonnull %arg)
175 ; 3. In f1:bb4 %tmp5 is nonnull and f3 is internal function.
176 ; Then, f3(i32* %arg) -> @f3(i32* nonnull %arg)
177 ; 4. We get nonnull in whole f1 call sites so f1(i32* %arg) -> @f1(i32* nonnull %arg)
181 ; FIXME: missing nonnull It should be nonnull @f1(i32* nonnull readonly %arg)
199 ; FIXME: missing nonnull. It should be @f2(i32* nonnull %arg)
209 ; FIXME: missing nonnull. It should be nonnull @f2(i32* nonnull %arg)
212 ; FIXME: missing nonnull. It should be @f1(i32* nonnull readonly %arg)
218 ; FIXME: missing nonnull. It should be nonnull @f3(i32* nonnull readonly %arg)
220 ; FIXME: missing nonnull. It should be @f1(i32* nonnull readonly %arg)
238 ; fun2(nonnull %a, nonnull %b)
240 ; fun2(nonnull %a, %b)
241 ; We can say that %a is nonnull but %b is not.
243 ; FIXME: missing nonnull on %a
247 tail call void @fun2(i8* nonnull %a, i8* nonnull %b)
250 tail call void @fun2(i8* nonnull %a, i8* %b)
258 ; fun1(nonnull %a)
259 ; We can say that %a is nonnull
270 tail call void @fun1(i8* nonnull %a)
282 ; fun1(nonnull %a)
297 tail call void @fun1(i8* nonnull %b)
303 tail call void @fun1(i8* nonnull %a)
310 ; FIXME: missing nonnull on %b
316 tail call void @fun1(i8* nonnull %b)
317 tail call void @fun1(i8* nonnull %a)
320 tail call void @fun1(i8* nonnull %b)
324 ; Test propagation of nonnull callsite args back to caller.
330 declare void @use1nonnull(i8* nonnull %x);
331 declare void @use2nonnull(i8* nonnull %x, i8* nonnull %y);
332 declare void @use3nonnull(i8* nonnull %x, i8* nonnull %y, i8* nonnull %z);
351 ; FNATTR-LABEL: @parent2(i8* nonnull %a, i8* nonnull %b, i8* nonnull %c)
365 ; FNATTR-LABEL: @parent3(i8* nonnull %a, i8* %b, i8* %c)
380 ; CHECK-LABEL: @parent4(i8* %a, i8* nonnull %b, i8* nonnull %c)
419 ; FNATTR-LABEL: @parent6(i8* nonnull %a, i8* %b)
429 ; The nonnull callsite is guaranteed to execute, so the argument must be nonnull throughout the par…
432 ; FNATTR-LABEL: @parent7(i8* nonnull %a)
450 ; FNATTR-LABEL: @parent8(i8* nonnull %a, i8* nocapture readnone %bogus1, i8* nonnull %b)
476 ; FNATTR: define nonnull i32* @gep1(
483 ; Should't be able to derive nonnull based on gep.
496 ; FIXME: We should propagate dereferenceable here but *not* nonnull
501 ; FNATTR: define internal nonnull i32* @g2()
518 define weak_odr void @weak_caller(i32* nonnull %a) {
523 ; Expect nonnull
528 ; Avoid nonnull as we do not touch naked functions
533 ; Avoid nonnull as we do not touch optnone
538 define void @make_live(i32* nonnull dereferenceable(8) %a) {
539 call void @naked(i32* nonnull dereferenceable(8) align 16 %a)
540 call void @control(i32* nonnull dereferenceable(8) align 16 %a)
541 call void @optnone(i32* nonnull dereferenceable(8) align 16 %a)
549 ; return g(nonnull u);
560 ; FNATTR-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A:%.*]])
575 %tmp5 = tail call i32 @g(i32* nonnull %a)
593 ; FNATTR-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A:%.*]])
610 %tmp5 = tail call i32 @g(i32* nonnull %a)
631 ; FNATTR-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A:%.*]])
646 %tmp5 = tail call i32 @g(i32* nonnull %a)
664 ; FNATTR-NEXT: [[TMP5:%.*]] = tail call i32 @g(i32* nonnull [[A:%.*]])
681 %tmp5 = tail call i32 @g(i32* nonnull %a)
698 ; FIXME: the sink argument should be marked nonnull as in @PR43833_simple.