[BDCE] Skip metadata while replacing uses.
authorDavide Italiano <davide@freebsd.org>
Wed, 7 Dec 2016 21:47:32 +0000 (21:47 +0000)
committerDavide Italiano <davide@freebsd.org>
Wed, 7 Dec 2016 21:47:32 +0000 (21:47 +0000)
commit1ed5396304ff6c29a043bed467f375efbff83d25
tree1e1208133139937a51509c8ec9309699abef5a1b
parent26d060fbf9fe5525f06f13c398ad1c564528fe57
[BDCE] Skip metadata while replacing uses.

The fix committed in r288851 doesn't cover all the cases.
In particular, if we have an instruction with side effects
which has a no non-dbg use not depending on the bits, we still
perform RAUW destroying the dbg.value's first argument.
Prevent metadata from being replaced here to avoid the issue.

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

llvm-svn: 288987
llvm/include/llvm/IR/Value.h
llvm/lib/IR/Value.cpp
llvm/lib/Transforms/Scalar/BDCE.cpp
llvm/test/Transforms/BDCE/dbg-multipleuses.ll [new file with mode: 0644]