]> granicus.if.org Git - llvm/commitdiff
Invariant.group and mustalias docs fixes
authorPiotr Padlewski <piotr.padlewski@gmail.com>
Wed, 12 Apr 2017 07:59:35 +0000 (07:59 +0000)
committerPiotr Padlewski <piotr.padlewski@gmail.com>
Wed, 12 Apr 2017 07:59:35 +0000 (07:59 +0000)
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@300033 91177308-0d34-0410-b5e6-96231b3b80d8

docs/AliasAnalysis.rst
docs/LangRef.rst

index 02b749ffb9181e106c560a62f4f21921836ae5e0..e201333f30070fc821ef34132e1d70cfbca98deb 100644 (file)
@@ -136,7 +136,7 @@ be overlapping in some way, but do not start at the same address.
 
 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
 -----------------------------
index c65c9eef7762df117061b96732c1da49aa8e1bde..1d0b9068d31e91300feecf56c78e639a770a13be 100644 (file)
@@ -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
 ^^^^^^^^^^^^^^^^^^^