forked from OSchip/llvm-project
parent
083712fbb7
commit
503a0ef6f4
|
@ -25,7 +25,6 @@
|
|||
#include "llvm/ADT/DepthFirstIterator.h"
|
||||
#include "llvm/Support/Debug.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
namespace {
|
||||
|
@ -67,7 +66,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
/// A DomainValue is a bit like LiveIntervals' ValNo, but it laso keeps track
|
||||
/// A DomainValue is a bit like LiveIntervals' ValNo, but it also keeps track
|
||||
/// of execution domains.
|
||||
///
|
||||
/// An open DomainValue represents a set of instructions that can still switch
|
||||
|
@ -168,7 +167,6 @@ private:
|
|||
void visitGenericInstr(MachineInstr*);
|
||||
void visitSoftInstr(MachineInstr*, unsigned mask);
|
||||
void visitHardInstr(MachineInstr*, unsigned domain);
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -286,15 +284,19 @@ void SSEDomainFixPass::enterBasicBlock() {
|
|||
if (fi == LiveOuts.end()) continue;
|
||||
DomainValue *pdv = fi->second[rx];
|
||||
if (!pdv) continue;
|
||||
if (!LiveRegs || !LiveRegs[rx])
|
||||
if (!LiveRegs || !LiveRegs[rx]) {
|
||||
SetLiveReg(rx, pdv);
|
||||
else {
|
||||
continue;
|
||||
}
|
||||
|
||||
// We have a live DomainValue from more than one predecessor.
|
||||
if (LiveRegs[rx]->collapsed()) {
|
||||
// We are already collapsed, but predecessor is not. Force him.
|
||||
if (!pdv->collapsed())
|
||||
Collapse(pdv, LiveRegs[rx]->firstDomain());
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Currently open, merge in predecessor.
|
||||
if (!pdv->collapsed())
|
||||
Merge(LiveRegs[rx], pdv);
|
||||
|
@ -303,8 +305,6 @@ void SSEDomainFixPass::enterBasicBlock() {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// A hard instruction only works in one domain. All input registers will be
|
||||
// forced into that domain.
|
||||
|
@ -392,13 +392,17 @@ void SSEDomainFixPass::visitSoftInstr(MachineInstr *mi, unsigned mask) {
|
|||
// priority to the latest ones.
|
||||
DomainValue *dv = 0;
|
||||
while (!doms.empty()) {
|
||||
if (!dv)
|
||||
dv = doms.back();
|
||||
else if (!Merge(dv, doms.back()))
|
||||
if (!dv) {
|
||||
dv = doms.pop_back_val();
|
||||
continue;
|
||||
}
|
||||
|
||||
DomainValue *ThisDV = doms.pop_back_val();
|
||||
if (Merge(dv, ThisDV)) continue;
|
||||
|
||||
for (SmallVector<int,4>::iterator i=used.begin(), e=used.end(); i != e; ++i)
|
||||
if (LiveRegs[*i] == doms.back())
|
||||
if (LiveRegs[*i] == ThisDV)
|
||||
Kill(*i);
|
||||
doms.pop_back();
|
||||
}
|
||||
|
||||
// dv is the DomainValue we are going to use for this instruction.
|
||||
|
|
Loading…
Reference in New Issue