aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/UnreachableBlockElim.cpp
diff options
context:
space:
mode:
authorCameron Zwarich <zwarich@apple.com>2011-05-27 05:04:51 +0000
committerCameron Zwarich <zwarich@apple.com>2011-05-27 05:04:51 +0000
commitf031d0977f8b03288ed32ff14f71c79e81914f39 (patch)
treedc6f0709486977f478b45d40f809459f390efc9b /lib/CodeGen/UnreachableBlockElim.cpp
parent3a5d7d0665e2c836fb7619ea1160b29c36827c4a (diff)
Fix PR10029 - VerifyCoalescing failure on patterns_dfa.c of 445.gobmk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132181 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/UnreachableBlockElim.cpp')
-rw-r--r--lib/CodeGen/UnreachableBlockElim.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/UnreachableBlockElim.cpp b/lib/CodeGen/UnreachableBlockElim.cpp
index 48d8ab1658..52693f03e8 100644
--- a/lib/CodeGen/UnreachableBlockElim.cpp
+++ b/lib/CodeGen/UnreachableBlockElim.cpp
@@ -196,8 +196,11 @@ bool UnreachableMachineBlockElim::runOnMachineFunction(MachineFunction &F) {
temp->eraseFromParent();
ModifiedPHI = true;
- if (Input != Output)
- F.getRegInfo().replaceRegWith(Output, Input);
+ if (Input != Output) {
+ MachineRegisterInfo &MRI = F.getRegInfo();
+ MRI.constrainRegClass(Input, MRI.getRegClass(Output));
+ MRI.replaceRegWith(Output, Input);
+ }
continue;
}