diff options
author | Dan Gohman <gohman@apple.com> | 2008-08-27 23:52:12 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-08-27 23:52:12 +0000 |
commit | 7c3234c6be0dc0bdf4b5d6f848cd728a77f349d7 (patch) | |
tree | aafdf0a2644f38b67f20c21b793e10c096659084 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | 8970f00deff00ffce1f35cf00883357e1582daa1 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 5c996a0b3e..0bd1a4d2d0 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/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(); |