std::vector<DomForestNode*> computeDomForest(std::set<unsigned>& instrs);
void processPHIUnion(MachineInstr* Inst,
std::set<unsigned>& PHIUnion,
- std::vector<StrongPHIElimination::DomForestNode*>& DF);
+ std::vector<StrongPHIElimination::DomForestNode*>& DF,
+ std::vector<std::pair<unsigned, unsigned> >& locals);
void breakCriticalEdges(MachineFunction &Fn);
};
computeDomForest(PHIUnion);
// Walk DomForest to resolve interferences
+ std::vector<std::pair<unsigned, unsigned> > localInterferences;
+ processPHIUnion(P, PHIUnion, DF, localInterferences);
+
+ // FIXME: Check for local interferences
ProcessedNames.insert(PHIUnion.begin(), PHIUnion.end());
++P;
void StrongPHIElimination::processPHIUnion(MachineInstr* Inst,
std::set<unsigned>& PHIUnion,
- std::vector<StrongPHIElimination::DomForestNode*>& DF) {
+ std::vector<StrongPHIElimination::DomForestNode*>& DF,
+ std::vector<std::pair<unsigned, unsigned> >& locals) {
std::vector<DomForestNode*> worklist(DF.begin(), DF.end());
SmallPtrSet<DomForestNode*, 4> visited;
visited.insert(DFNode);
bool inserted = false;
- SmallPtrSet<DomForestNode*, 4> interferences;
for (DomForestNode::iterator CI = DFNode->begin(), CE = DFNode->end();
CI != CE; ++CI) {
DomForestNode* child = *CI;
}
} else if (isLiveIn(Info, CInfo.DefInst->getParent()) ||
Info.DefInst->getParent() == CInfo.DefInst->getParent()) {
- // FIXME: Add (p, c) to possible local interferences
+ // Add (p, c) to possible local interferences
+ locals.push_back(std::make_pair(DFNode->getReg(), child->getReg()));
}
if (!visited.count(child)) {