[InstCombine] Preserve metadata when merging loads that are phi
authorAkira Hatanaka <ahatanaka@apple.com>
Wed, 23 Sep 2015 18:40:57 +0000 (18:40 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Wed, 23 Sep 2015 18:40:57 +0000 (18:40 +0000)
commit84e146173d700db89ec28a7e4c4ea38e2062d1b1
tree5309fb0da18ea00efd534934709bb919d9d5057f
parent710fde88688bb4919404f37fa54ae9272bccea2f
[InstCombine] Preserve metadata when merging loads that are phi
arguments.

Make sure InstCombiner::FoldPHIArgLoadIntoPHI doesn't drop the following
metadata:

MD_tbaa
MD_alias_scope
MD_noalias
MD_invariant_load
MD_nonnull
MD_range

rdar://problem/17617709

Differential Revision: http://reviews.llvm.org/D12710

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248419 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombinePHI.cpp
test/Transforms/InstCombine/fold-phi-load-metadata.ll [new file with mode: 0644]