[PATCH] D31758: Invariant.group and mustalias docs fixes

Piotr Padlewski via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 06:31:22 PDT 2017


Prazek created this revision.

Alias analysis would like to know that
invariant.group.barrier returns pointer that mustalias,
but this can't imply that we can replace one pointer with another


https://reviews.llvm.org/D31758

Files:
  docs/AliasAnalysis.rst
  docs/LangRef.rst


Index: docs/LangRef.rst
===================================================================
--- docs/LangRef.rst
+++ docs/LangRef.rst
@@ -5118,6 +5118,19 @@
    !0 = !{!"magic ptr"}
    !1 = !{!"other ptr"}
 
+Because `invariant.group` is tied to the SSA value of the pointer operand,
+replacing one pointer by another based on `mustalias` returned from Alias
+Analysis can't be done without discarding the `invariant.group` metadata.
+.. code-block:: llvm
+  %v = load i8, i8* %x, !invariant.group !0
+  ; if %x mustalias %y then we can replace the above instruction with
+  %v = load i8, i8* %y
+
+Where replacing by SSA values equivalence is not required to discard
+`invariant.group` metadata.
+
+
+
 '``type``' Metadata
 ^^^^^^^^^^^^^^^^^^^
 
Index: docs/AliasAnalysis.rst
===================================================================
--- docs/AliasAnalysis.rst
+++ docs/AliasAnalysis.rst
@@ -136,7 +136,7 @@
 
 The ``MustAlias`` response may only be returned if the two memory objects are
 guaranteed to always start at exactly the same location. A ``MustAlias``
-response implies that the pointers compare equal.
+response not implies that the pointers compare equal.
 
 The ``getModRefInfo`` methods
 -----------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31758.94361.patch
Type: text/x-patch
Size: 1245 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170406/475da1e6/attachment.bin>


More information about the llvm-commits mailing list