[PATCH] D68484: [PATCH 01/27] [noalias] LangRef: noalias intrinsics and ptr_provenance documentation.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 1 07:40:57 PST 2020


asbirlea added a comment.

A few comments inline.



================
Comment at: llvm/docs/LangRef.rst:19177
+                                            i32 <p.objId>, metadata !p.scope) !noalias !VisibleScopes
+      %prov.p       = i8* @llvm.provenance.noalias.XXX(i8* %prov.p, i8* %p.decl,
+                                            i8** p.addr, i8** %prov.p.addr,
----------------
Should this be: 
`%prov.p       = i8* @llvm.provenance.noalias.XXX(i8* %p, i8* %p.decl,` ?
Or could you clarify the `%prov.p` on both sides?


================
Comment at: llvm/docs/NoAliasInfo.rst:266
+      %0 = call i8* @llvm.noalias.decl(i32** null, i64 0, metadata !2) ; rpA - inside the loop
+      %1 = call i8* @llvm.noalias.decl(i32** null, i64 0, metadata !5) ; rpB - inside the loop
+    ...
----------------
This seems like it may be useful to see a fragment/sample of the metadata declarations here?
Similar for the `OutOfLoop` snippet.


================
Comment at: llvm/docs/NoAliasInfo.rst:362
+      %rpA.address = alloca i32*
+      %rpA.decl = call @llvm.noalias.decl %rpA.address, !metadata !10 ; declaration of a restrict pointer
+      store i32* %pA, i32** %rpA.address, !noalias !10
----------------
IIUC, this example looks like a good place to clarify the distinction between `p.alloca` and `p.addr` in the LangRef description, along the lines of "in this example the address is the alloca, but in general they may refer to different locations; the alloca could be a struct and the address could point to a member of the struct".


================
Comment at: llvm/docs/NoAliasInfo.rst:373
+With this representation, we have enough information to decide whether two
+load/stores are not aliasing, based on the ``noalias`` annotations. But, the
+added intrinsics must block optimizations. Later on we will see how the
----------------
Expand with explanation on what does not alias in the example.


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

https://reviews.llvm.org/D68484



More information about the llvm-commits mailing list