[llvm] r300033 - Invariant.group and mustalias docs fixes

Piotr Padlewski via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 00:59:36 PDT 2017


Author: prazek
Date: Wed Apr 12 02:59:35 2017
New Revision: 300033

URL: http://llvm.org/viewvc/llvm-project?rev=300033&view=rev
Log:
Invariant.group and mustalias docs fixes

Summary:
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

Reviewers: dberlin, sanjoy

Subscribers: llvm-commits, chandlerc, hfinkel, nlewycky, amharc

Differential Revision: https://reviews.llvm.org/D31758

Modified:
    llvm/trunk/docs/AliasAnalysis.rst
    llvm/trunk/docs/LangRef.rst

Modified: llvm/trunk/docs/AliasAnalysis.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/AliasAnalysis.rst?rev=300033&r1=300032&r2=300033&view=diff
==============================================================================
--- llvm/trunk/docs/AliasAnalysis.rst (original)
+++ llvm/trunk/docs/AliasAnalysis.rst Wed Apr 12 02:59:35 2017
@@ -136,7 +136,7 @@ be overlapping in some way, but do not s
 
 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 does not imply that the pointers compare equal.
 
 The ``getModRefInfo`` methods
 -----------------------------

Modified: llvm/trunk/docs/LangRef.rst
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/LangRef.rst?rev=300033&r1=300032&r2=300033&view=diff
==============================================================================
--- llvm/trunk/docs/LangRef.rst (original)
+++ llvm/trunk/docs/LangRef.rst Wed Apr 12 02:59:35 2017
@@ -5121,6 +5121,16 @@ Examples:
    !0 = !{!"magic ptr"}
    !1 = !{!"other ptr"}
 
+The invariant.group metadata must be dropped when replacing one pointer by
+another based on aliasing information. This is because invariant.group is tied
+to the SSA value of the pointer operand.
+
+.. 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
+
+
 '``type``' Metadata
 ^^^^^^^^^^^^^^^^^^^
 




More information about the llvm-commits mailing list