summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/CodeGen/UnreachableBlockElim.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/UnreachableBlockElim.cpp b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
index ca682fd65a0..f1e3aabaebe 100644
--- a/llvm/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/llvm/lib/CodeGen/UnreachableBlockElim.cpp
@@ -137,7 +137,8 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
start++;
phi->eraseFromParent();
- F.getRegInfo().replaceRegWith(Output, Input);
+ if (Input != Output)
+ F.getRegInfo().replaceRegWith(Output, Input);
} else
start++;
}
OpenPOWER on IntegriCloud