[PATCH] D90529: Allow nonnull/align attribute to accept poison

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 00:18:29 PST 2021


aqjune added a comment.

In D90529#2584092 <https://reviews.llvm.org/D90529#2584092>, @MaskRay wrote:

> I got a bit confused by the summary until I realized that I should read it this way:) Perhaps you can still edit the summary like the following:
>
> This propagates the nonnull attribute to the caller in the following case:
>
>   %p = gep inbounds %x, 1 ; % p is non-null pointer or poison
>   call void @f(%p)        ; instcombine converts this to call void @f(nonnull %p)
>
> <del>Instead, </del>This patch makes it illegal to propagate the nonnull attribute to the caller, e.g.
>
>   define void @f(i8* %p) {       ; functionattr cannot mark %p nonnull here anymore
>     call void @g(i8* nonnull %p) ; .. because @g never raises UB if it never uses %p.
>     ret void
>   }
>
> To re-allow nonnull propagation to the caller, the caller should have the noundef attribute.

Edited the summary, thanks :)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90529/new/

https://reviews.llvm.org/D90529



More information about the llvm-commits mailing list