summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-27 23:52:12 +0000
committerDan Gohman <gohman@apple.com>2008-08-27 23:52:12 +0000
commite1a9a780a5092d9300be3b3c601a25ee83325187 (patch)
tree705ea2e7d47befbedb3af159de4cda16f2a4663b /llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
parent3a01c1eb8e7b4ed788a64c62d9242ac36f988fae (diff)
downloadbcm5719-llvm-e1a9a780a5092d9300be3b3c601a25ee83325187.tar.gz
bcm5719-llvm-e1a9a780a5092d9300be3b3c601a25ee83325187.zip
Reorganize the lifetimes of the major objects SelectionDAGISel
works with. SelectionDAG, FunctionLoweringInfo, and SelectionDAGLowering objects now get created once per SelectionDAGISel instance, and can be reused across blocks and across functions. Previously, they were created and destroyed each time they were needed. This reorganization simplifies the handling of PHI nodes, and also SwitchCases, JumpTables, and BitTestBlocks. This simplification has the side effect of fixing a bug in FastISel where successor PHI nodes weren't being updated correctly. This is also a step towards making the transition from FastISel into and out of SelectionDAG faster, and also making plain SelectionDAG faster on code with lots of little blocks. llvm-svn: 55450
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index 5c996a0b3e6..0bd1a4d2d08 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -765,14 +765,18 @@ unsigned SelectionDAG::getMVTAlignment(MVT VT) const {
return TLI.getTargetData()->getABITypeAlignment(Ty);
}
-SelectionDAG::SelectionDAG(TargetLowering &tli, MachineFunction &mf,
- FunctionLoweringInfo &fli, MachineModuleInfo *mmi)
- : TLI(tli), MF(mf), FLI(fli), MMI(mmi),
- EntryNode(ISD::EntryToken, getVTList(MVT::Other)),
+SelectionDAG::SelectionDAG(TargetLowering &tli, FunctionLoweringInfo &fli)
+ : TLI(tli), FLI(fli),
+ EntryNode(ISD::EntryToken, getVTList(MVT::Other)),
Root(getEntryNode()) {
AllNodes.push_back(&EntryNode);
}
+void SelectionDAG::init(MachineFunction &mf, MachineModuleInfo *mmi) {
+ MF = &mf;
+ MMI = mmi;
+}
+
SelectionDAG::~SelectionDAG() {
allnodes_clear();
}
@@ -789,7 +793,7 @@ void SelectionDAG::allnodes_clear() {
}
}
-void SelectionDAG::reset() {
+void SelectionDAG::clear() {
allnodes_clear();
OperandAllocator.Reset();
CSEMap.clear();
OpenPOWER on IntegriCloud