diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/ExecutionDepsFix.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/ExecutionDepsFix.cpp b/lib/CodeGen/ExecutionDepsFix.cpp index bd77f65..5aa80f9 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; |