Add register pairs to the list to check for local interferences.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44987 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/StrongPHIElimination.cpp b/lib/CodeGen/StrongPHIElimination.cpp
index eef10ef..9b1c163 100644
--- a/lib/CodeGen/StrongPHIElimination.cpp
+++ b/lib/CodeGen/StrongPHIElimination.cpp
@@ -99,7 +99,8 @@
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);
};
@@ -300,6 +301,10 @@
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;
@@ -308,7 +313,8 @@
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;
@@ -323,7 +329,6 @@
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;
@@ -342,7 +347,8 @@
}
} 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)) {