mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-21 03:53:04 +02:00
Factor code that finalize PHI nodes, jump tables, etc. out of SelectBasicBlock. No functionality changes.
llvm-svn: 54438
This commit is contained in:
parent
2975ced4df
commit
f8a801a9b8
@ -182,6 +182,11 @@ private:
|
||||
FunctionLoweringInfo &FuncInfo);
|
||||
void SelectBasicBlock(BasicBlock *BB, MachineFunction &MF,
|
||||
FunctionLoweringInfo &FuncInfo,
|
||||
std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
|
||||
NodeAllocatorType &NodeAllocator);
|
||||
void FinishBasicBlock(BasicBlock *BB, MachineFunction &MF,
|
||||
FunctionLoweringInfo &FuncInfo,
|
||||
std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
|
||||
NodeAllocatorType &NodeAllocator);
|
||||
|
||||
void BuildSelectionDAG(SelectionDAG &DAG, BasicBlock *LLVMBB,
|
||||
|
@ -5441,16 +5441,20 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF,
|
||||
// each basic block.
|
||||
NodeAllocatorType NodeAllocator;
|
||||
|
||||
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
|
||||
SelectBasicBlock(I, MF, FuncInfo, NodeAllocator);
|
||||
std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate;
|
||||
for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I) {
|
||||
BasicBlock *LLVMBB = &*I;
|
||||
PHINodesToUpdate.clear();
|
||||
SelectBasicBlock(LLVMBB, MF, FuncInfo, PHINodesToUpdate, NodeAllocator);
|
||||
FinishBasicBlock(LLVMBB, MF, FuncInfo, PHINodesToUpdate, NodeAllocator);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
|
||||
FunctionLoweringInfo &FuncInfo,
|
||||
std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
|
||||
NodeAllocatorType &NodeAllocator) {
|
||||
std::vector<std::pair<MachineInstr*, unsigned> > PHINodesToUpdate;
|
||||
{
|
||||
SelectionDAG DAG(TLI, MF, FuncInfo,
|
||||
getAnalysisToUpdate<MachineModuleInfo>(),
|
||||
NodeAllocator);
|
||||
@ -5464,6 +5468,11 @@ SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
|
||||
CodeGenAndEmitDAG(DAG);
|
||||
}
|
||||
|
||||
void
|
||||
SelectionDAGISel::FinishBasicBlock(BasicBlock *LLVMBB, MachineFunction &MF,
|
||||
FunctionLoweringInfo &FuncInfo,
|
||||
std::vector<std::pair<MachineInstr*, unsigned> > &PHINodesToUpdate,
|
||||
NodeAllocatorType &NodeAllocator) {
|
||||
DOUT << "Total amount of phi nodes to update: "
|
||||
<< PHINodesToUpdate.size() << "\n";
|
||||
DEBUG(for (unsigned i = 0, e = PHINodesToUpdate.size(); i != e; ++i)
|
||||
|
Loading…
Reference in New Issue
Block a user