1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 12:12:47 +01:00

Remove ugly and horrible code. It's not necessary for correctness, and can be added back later if it causes code quality issues.

llvm-svn: 44986
This commit is contained in:
Owen Anderson 2007-12-13 05:43:37 +00:00
parent a152909956
commit 78b8141ce7

View File

@ -330,43 +330,6 @@ void StrongPHIElimination::processPHIUnion(MachineInstr* Inst,
LiveVariables::VarInfo& CInfo = LV.getVarInfo(child->getReg());
if (isLiveOut(Info, CInfo.DefInst->getParent())) {
interferences.insert(child);
} else if (isLiveIn(Info, CInfo.DefInst->getParent()) ||
Info.DefInst->getParent() == CInfo.DefInst->getParent()) {
// FIXME: Add (p, c) to possible local interferences
}
if (!visited.count(child)) {
worklist.push_back(child);
inserted = true;
}
}
if (interferences.size() == 1) {
DomForestNode* child = *interferences.begin();
unsigned numParentCopies = 0;
unsigned numChildCopies = 0;
for (int i = Inst->getNumOperands() - 1; i >= 2; i-=2) {
unsigned SrcReg = Inst->getOperand(i-1).getReg();
if (SrcReg == DFNode->getReg()) numParentCopies++;
else if (SrcReg == child->getReg()) numChildCopies++;
}
if (numParentCopies < numChildCopies) {
// Insert copies for child
for (int i = Inst->getNumOperands() - 1; i >= 2; i-=2) {
if (Inst->getOperand(i-1).getReg() == child->getReg()) {
unsigned SrcReg = child->getReg();
MachineBasicBlock* From = Inst->getOperand(i).getMBB();
Waiting[From].push_back(std::make_pair(SrcReg, DestReg));
PHIUnion.erase(SrcReg);
}
}
// FIXME: Make child's children parent's children
} else {
// Insert copies for parent
for (int i = Inst->getNumOperands() - 1; i >= 2; i-=2) {
if (Inst->getOperand(i-1).getReg() == DFNode->getReg()) {
@ -377,17 +340,14 @@ void StrongPHIElimination::processPHIUnion(MachineInstr* Inst,
PHIUnion.erase(SrcReg);
}
}
} else if (isLiveIn(Info, CInfo.DefInst->getParent()) ||
Info.DefInst->getParent() == CInfo.DefInst->getParent()) {
// FIXME: Add (p, c) to possible local interferences
}
} else if (interferences.size() > 1) {
// Insert copies for parent
for (int i = Inst->getNumOperands() - 1; i >= 2; i-=2) {
if (Inst->getOperand(i-1).getReg() == DFNode->getReg()) {
unsigned SrcReg = DFNode->getReg();
MachineBasicBlock* From = Inst->getOperand(i).getMBB();
Waiting[From].push_back(std::make_pair(SrcReg, DestReg));
PHIUnion.erase(SrcReg);
}
if (!visited.count(child)) {
worklist.push_back(child);
inserted = true;
}
}