While sinking an instruction, do not lose llvm.dbg.value intrinsic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127214 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Devang Patel
2011-03-08 03:06:19 +00:00
parent ebc2fc1e2c
commit 290342a157
2 changed files with 64 additions and 1 deletions

View File

@@ -445,7 +445,8 @@ void LICM::sink(Instruction &I) {
// enough that we handle it as a special (more efficient) case. It is more
// efficient to handle because there are no PHI nodes that need to be placed.
if (ExitBlocks.size() == 1) {
if (!DT->dominates(I.getParent(), ExitBlocks[0])) {
if (!isa<DbgInfoIntrinsic>(I) &&
!DT->dominates(I.getParent(), ExitBlocks[0])) {
// Instruction is not used, just delete it.
CurAST->deleteValue(&I);
// If I has users in unreachable blocks, eliminate.