[llvm-commits] [llvm] r43751 - /llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Owen Anderson
resistor at mac.com
Mon Nov 5 20:49:44 PST 2007
Author: resistor
Date: Mon Nov 5 22:49:43 2007
New Revision: 43751
URL: http://llvm.org/viewvc/llvm-project?rev=43751&view=rev
Log:
StrongPHIElimination requires LiveVariables.
Modified:
llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
Modified: llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp?rev=43751&r1=43750&r2=43751&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp (original)
+++ llvm/trunk/lib/CodeGen/StrongPHIElimination.cpp Mon Nov 5 22:49:43 2007
@@ -37,23 +37,22 @@
static char ID; // Pass identification, replacement for typeid
StrongPHIElimination() : MachineFunctionPass((intptr_t)&ID) {}
- bool runOnMachineFunction(MachineFunction &Fn) {
- computeDFS(Fn);
-
-
- return false;
- }
-
+ bool runOnMachineFunction(MachineFunction &Fn);
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.addPreserved<LiveVariables>();
AU.addPreservedID(PHIEliminationID);
AU.addRequired<MachineDominatorTree>();
+ AU.addRequired<LiveVariables>();
+ AU.setPreservesAll();
MachineFunctionPass::getAnalysisUsage(AU);
}
virtual void releaseMemory() {
preorder.clear();
maxpreorder.clear();
+
+ waiting.clear();
}
private:
@@ -72,15 +71,23 @@
parent->addChild(this);
}
- MachineInstr* getInstr() { return instr; }
+ ~DomForestNode() {
+ for (iterator I = begin(), E = end(); I != E; ++I)
+ delete *I;
+ }
- DomForestNode::iterator begin() { return children.begin(); }
- DomForestNode::iterator end() { return children.end(); }
+ inline MachineInstr* getInstr() { return instr; }
+
+ inline DomForestNode::iterator begin() { return children.begin(); }
+ inline DomForestNode::iterator end() { return children.end(); }
};
DenseMap<MachineBasicBlock*, unsigned> preorder;
DenseMap<MachineBasicBlock*, unsigned> maxpreorder;
+ DenseMap<MachineBasicBlock*, std::vector<MachineInstr*> > waiting;
+
+
void computeDFS(MachineFunction& MF);
std::vector<DomForestNode*>
@@ -198,3 +205,10 @@
ret.insert(ret.end(), VirtualRoot->begin(), VirtualRoot->end());
return ret;
}
+
+bool StrongPHIElimination::runOnMachineFunction(MachineFunction &Fn) {
+ computeDFS(Fn);
+
+
+ return false;
+}
More information about the llvm-commits
mailing list