summaryrefslogtreecommitdiff
path: root/lib/CodeGen/ExecutionDepsFix.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-08 20:57:04 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2011-11-08 20:57:04 +0000
commite1b3e11c15b705ad55c5ff2b04a0b790599013ea (patch)
tree323e95e13cbd7a4168a4b86e01fad0b3f7f99248 /lib/CodeGen/ExecutionDepsFix.cpp
parent0d64632c9e8a2632b8804bcc3fbc3523588862a7 (diff)
downloadllvm-e1b3e11c15b705ad55c5ff2b04a0b790599013ea.tar.gz
llvm-e1b3e11c15b705ad55c5ff2b04a0b790599013ea.tar.bz2
llvm-e1b3e11c15b705ad55c5ff2b04a0b790599013ea.tar.xz
Clear old DomainValue after merging.
The old value may still be referenced by some live-out list, and we don't wan't to collapse those instructions twice. This fixes the "Can only swizzle VMOVD" assertion in some armv7 SPEC builds. <rdar://problem/10413292> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ExecutionDepsFix.cpp')
-rw-r--r--lib/CodeGen/ExecutionDepsFix.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/ExecutionDepsFix.cpp b/lib/CodeGen/ExecutionDepsFix.cpp
index bd77f655c1..5aa80f9a06 100644
--- a/lib/CodeGen/ExecutionDepsFix.cpp
+++ b/lib/CodeGen/ExecutionDepsFix.cpp
@@ -266,6 +266,11 @@ bool ExeDepsFix::Merge(DomainValue *A, DomainValue *B) {
A->AvailableDomains = common;
A->Dist = std::max(A->Dist, B->Dist);
A->Instrs.append(B->Instrs.begin(), B->Instrs.end());
+
+ // Clear the old DomainValue so we won't try to swizzle instructions twice.
+ B->Instrs.clear();
+ B->AvailableDomains = 0;
+
for (unsigned rx = 0; rx != NumRegs; ++rx)
if (LiveRegs[rx] == B)
SetLiveReg(rx, A);
@@ -283,7 +288,7 @@ void ExeDepsFix::enterBasicBlock(MachineBasicBlock *MBB) {
LiveOutMap::const_iterator fi = LiveOuts.find(*pi);
if (fi == LiveOuts.end()) continue;
DomainValue *pdv = fi->second[rx];
- if (!pdv) continue;
+ if (!pdv || !pdv->AvailableDomains) continue;
if (!LiveRegs || !LiveRegs[rx]) {
SetLiveReg(rx, pdv);
continue;