diff options
author | Piotr Padlewski <piotr.padlewski@gmail.com> | 2016-12-30 18:45:07 +0000 |
---|---|---|
committer | Piotr Padlewski <piotr.padlewski@gmail.com> | 2016-12-30 18:45:07 +0000 |
commit | da362150174d5c2d535ee045413ed31357f8ca16 (patch) | |
tree | 2bcc4c2576f47d867f568d521ef71bf809e5cc94 /llvm/docs/LangRef.rst | |
parent | 20dfba0d707ed664d63334854be03257edc814fc (diff) | |
download | bcm5719-llvm-da362150174d5c2d535ee045413ed31357f8ca16.tar.gz bcm5719-llvm-da362150174d5c2d535ee045413ed31357f8ca16.zip |
[MemDep] Handle gep with zeros for invariant.group
Summary:
gep 0, 0 is equivalent to bitcast. LLVM canonicalizes it
to getelementptr because it make SROA can then handle it.
Simple case like
void g(A &a) {
z(a);
if (glob)
a.foo();
}
void testG() {
A a;
g(a);
}
was not devirtualized with -fstrict-vtable-pointers because luck of
handling for gep 0 in Memory Dependence Analysis
Reviewers: dberlin, nlewycky, chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D28126
llvm-svn: 290763
Diffstat (limited to 'llvm/docs/LangRef.rst')
-rw-r--r-- | llvm/docs/LangRef.rst | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index e8dc8319d9c..ecf37bab55d 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -4904,7 +4904,8 @@ The existence of the ``invariant.group`` metadata on the instruction tells the optimizer that every ``load`` and ``store`` to the same pointer operand within the same invariant group can be assumed to load or store the same value (but see the ``llvm.invariant.group.barrier`` intrinsic which affects -when two pointers are considered the same). +when two pointers are considered the same). Pointers returned by bitcast or +getelementptr with only zero indices are considered the same. Examples: |