llvm-project/llvm
Anna Thomas 4b027e8f89 [RS4GC] Drop invalid metadata after pointers are relocated
Summary:
After RS4GC, we should drop metadata that is no longer valid. These metadata
is used by optimizations scheduled after RS4GC, and can cause a miscompile.
One such metadata is invariant.load which is used by LICM sinking transform.
After rewriting statepoints, the address of a load maybe relocated. With
invariant.load metadata on a load instruction, LICM sinking assumes the
loaded value (from a dererenceable address) to be invariant, and
rematerializes the load operand and the load at the exit block.
This transforms the IR to have an unrelocated use of the
address after a statepoint, which is incorrect.
Other metadata we conservatively remove are related to
dereferenceability and noalias metadata.

This patch drops such metadata on store and load instructions after
rewriting statepoints.

Reviewers: reames, sanjoy, apilipenko

Reviewed by: reames

Subscribers: llvm-commits

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

llvm-svn: 305234
2017-06-12 21:26:53 +00:00
..
bindings [Go] Subtypes function 2017-06-08 07:32:29 +00:00
cmake Addressed Takumi's comment about redundancy. 2017-06-12 19:17:55 +00:00
docs IR: Replace the "Linker Options" module flag with "llvm.linker.options" named metadata. 2017-06-12 20:10:48 +00:00
examples Move Object format code to lib/BinaryFormat. 2017-06-07 03:48:56 +00:00
include [ADT] Reduce duplication between {Contextual,}FoldingSet; NFC 2017-06-12 20:52:53 +00:00
lib [RS4GC] Drop invalid metadata after pointers are relocated 2017-06-12 21:26:53 +00:00
projects Add temporary workaround to allow in-tree libc++ builds on Windows 2017-05-11 01:44:30 +00:00
resources
runtimes [CMake][runtimes] Add install target for runtimes builtins 2017-06-02 19:38:11 +00:00
test [RS4GC] Drop invalid metadata after pointers are relocated 2017-06-12 21:26:53 +00:00
tools Fix a null pointer dereference in llvm-pdbutil pretty. 2017-06-12 20:46:35 +00:00
unittests [ADT] Don't use __used__ attribute on struct members in unit test 2017-06-12 14:19:25 +00:00
utils [utils] remove ability to generate llc check lines from update_test_checks.py 2017-06-12 17:44:30 +00:00
.arcconfig
.clang-format
.clang-tidy
.gitignore
CMakeLists.txt Enable c++1z experimental builds. 2017-06-09 22:09:57 +00:00
CODE_OWNERS.TXT
CREDITS.TXT update of the url 2017-05-14 07:55:01 +00:00
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in

README.txt

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.