]> granicus.if.org Git - llvm/commit
[Transforms] Do not drop !preserve.access.index metadata
authorYonghong Song <yhs@fb.com>
Sat, 3 Aug 2019 23:41:26 +0000 (23:41 +0000)
committerYonghong Song <yhs@fb.com>
Sat, 3 Aug 2019 23:41:26 +0000 (23:41 +0000)
commit2bf6c5f7b055e15fe1a93c592dd5b9cfb1b1ceea
tree54db7e91d213888770d7220fc4453380985c9bd6
parentdcdaa66d662c682601e4093e9a840d46411e68dd
[Transforms] Do not drop !preserve.access.index metadata

Currently, when a GVN or CSE optimization happens,
the llvm.preserve.access.index metadata is dropped.
This caused a problem for BPF AbstructMemberOffset phase
as it relies on the metadata (debuginfo types).

This patch added proper hooks in lib/Transforms to
preserve !preserve.access.index metadata. A test
case is added to ensure metadata is preserved under CSE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367769 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/Local.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
test/CodeGen/BPF/CORE/intrinsic-transforms.ll [new file with mode: 0644]