[PATCH] D68484: [PATCH 01/26] [noalias] LangRef: noalias intrinsics and noalias_sidechannel documentation.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 12 13:42:23 PDT 2020


efriedma added a comment.

In D68484#2090569 <https://reviews.llvm.org/D68484#2090569>, @jeroen.dobbelaere wrote:

> In D68484#2090338 <https://reviews.llvm.org/D68484#2090338>, @efriedma wrote:
>
> > If I'm understanding correctly, `llvm.noalias.arg.guard(p, q)` is equivalent to `getelementptr q, p-q`?
>
>
> This is not correct: the 'llvm.noalias.arg.guard(p,ptr_provenance)' combines the 'value of the pointer' (p) with the 'provenance of the pointer' (ptr_provenance). 
>  The ptr_provenance does not has a real 'value'. It is more like a dependency.
>
> When you follow both, they should come together at some point, like at the input argument of a function :
>
> - the ptr_provenance purpose is to track the llvm.provenance.noalias information (and its dependencies). Normally there are no computations on this path.
> - the normal 'p' path, should in the best case only contain computations.
>
>   Due to inlining, it is possible that somewhere in the flow, the normal 'p' path also contains noalias information. The propagation pass should flatten that out.


`getelementptr q, (ptrtoint(p)-ptrtoint(q))` should return a pointer with provenance of q, and the value of p.  (http://llvm.org/docs/LangRef.html#pointer-aliasing-rules).  I can't see how it isn't equivalent... unless noalias provenance is somehow different from the usual aliasing rules.

Does the presence of provenance markings fix https://bugs.llvm.org/show_bug.cgi?id=35229 ?

>>   And llvm.noalias.copy.guard is equivalent to loading a pointer, applying llvm.noalias to it, and storing it back to the same address?
> 
> No.
> 
> llvm.noalias.copy.guard  tells that the pointer it returns has restrict pointers as specified by the struct indices (encoded in the metadata value).

Oh, I see, it only applies the provenance to loads derived from that pointer, not all loads from the memory.


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

https://reviews.llvm.org/D68484





More information about the llvm-commits mailing list