diff options
author | Dan Gohman <gohman@apple.com> | 2008-07-28 21:51:04 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-07-28 21:51:04 +0000 |
commit | 804c95df52ebfba155aa5697aeb283adcd28477a (patch) | |
tree | c3bdab8fada8c2fa76f62c12ee40275667d6ed02 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | 813bf7af7f62c0a8cff9bcefadab766cd85641c2 (diff) | |
download | bcm5719-llvm-804c95df52ebfba155aa5697aeb283adcd28477a.tar.gz bcm5719-llvm-804c95df52ebfba155aa5697aeb283adcd28477a.zip |
Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.
Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.
Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.
llvm-svn: 54146
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 7d34ca27449..c0652da35d1 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -5425,24 +5425,23 @@ void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) { void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF, FunctionLoweringInfo &FuncInfo) { - // Define AllNodes here so that memory allocation is reused for + // Define NodeAllocator here so that memory allocation is reused for // each basic block. - alist<SDNode, LargestSDNode> AllNodes; + NodeAllocatorType NodeAllocator; - for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) { - SelectBasicBlock(I, MF, FuncInfo, AllNodes); - AllNodes.clear(); - } + for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) + SelectBasicBlock(I, MF, FuncInfo, NodeAllocator); } -void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, - FunctionLoweringInfo &FuncInfo, - alist<SDNode, LargestSDNode> &AllNodes) { +void +SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, + FunctionLoweringInfo &FuncInfo, + NodeAllocatorType &NodeAllocator) { std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate; { SelectionDAG DAG(TLI, MF, FuncInfo, getAnalysisToUpdate<MachineModuleInfo>(), - AllNodes); + NodeAllocator); CurDAG = &DAG; // First step, lower LLVM code to some DAG. This DAG may use operations and @@ -5478,7 +5477,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, if (!BitTestCases[i].Emitted) { SelectionDAG HSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate<MachineModuleInfo>(), - AllNodes); + NodeAllocator); CurDAG = &HSDAG; SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5493,7 +5492,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, for (unsigned j = 0, ej = BitTestCases[i].Cases.size(); j != ej; ++j) { SelectionDAG BSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate<MachineModuleInfo>(), - AllNodes); + NodeAllocator); CurDAG = &BSDAG; SelectionDAGLowering BSDL(BSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5552,7 +5551,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, if (!JTCases[i].first.Emitted) { SelectionDAG HSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate<MachineModuleInfo>(), - AllNodes); + NodeAllocator); CurDAG = &HSDAG; SelectionDAGLowering HSDL(HSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5566,7 +5565,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, SelectionDAG JSDAG(TLI, MF, FuncInfo, getAnalysisToUpdate<MachineModuleInfo>(), - AllNodes); + NodeAllocator); CurDAG = &JSDAG; SelectionDAGLowering JSDL(JSDAG, TLI, *AA, FuncInfo, GCI); // Set the current basic block to the mbb we wish to insert the code into @@ -5616,7 +5615,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF, for (unsigned i = 0, e = SwitchCases.size(); i != e; ++i) { SelectionDAG SDAG(TLI, MF, FuncInfo, getAnalysisToUpdate<MachineModuleInfo>(), - AllNodes); + NodeAllocator); CurDAG = &SDAG; SelectionDAGLowering SDL(SDAG, TLI, *AA, FuncInfo, GCI); |