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
A->AvailableDomains = common;
A->Dist = std::max(A->Dist, B->Dist);
A->Instrs.append(B->Instrs.begin(), B->Instrs.end());
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);
for (unsigned rx = 0; rx != NumRegs; ++rx)
if (LiveRegs[rx] == B)
SetLiveReg(rx, A);
LiveOutMap::const_iterator fi = LiveOuts.find(*pi);
if (fi == LiveOuts.end()) continue;
DomainValue *pdv = fi->second[rx];
LiveOutMap::const_iterator fi = LiveOuts.find(*pi);
if (fi == LiveOuts.end()) continue;
DomainValue *pdv = fi->second[rx];
+ if (!pdv || !pdv->AvailableDomains) continue;
if (!LiveRegs || !LiveRegs[rx]) {
SetLiveReg(rx, pdv);
continue;
if (!LiveRegs || !LiveRegs[rx]) {
SetLiveReg(rx, pdv);
continue;