Simplify SelectRoot's interface, and factor out some common code

from all targets.

llvm-svn: 55124
This commit is contained in:
Dan Gohman 2008-08-21 16:36:34 +00:00
parent 75ea0b83c5
commit d3582c9bda
10 changed files with 11 additions and 11 deletions

View File

@ -153,7 +153,7 @@ void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {
/// SelectRoot - Top level entry to DAG instruction selector.
/// Selects instructions starting at the root of the current DAG.
SDValue SelectRoot(SDValue Root) {
void SelectRoot() {
SelectRootInit();
unsigned NumBytes = (DAGSize + 7) / 8;
ISelQueued = new unsigned char[NumBytes];
@ -197,7 +197,7 @@ SDValue SelectRoot(SDValue Root) {
ISelQueued = NULL;
delete[] ISelSelected;
ISelSelected = NULL;
return Dummy.getValue();
CurDAG->setRoot(Dummy.getValue());
}
#endif /* LLVM_CODEGEN_DAGISEL_HEADER_H */

View File

@ -94,7 +94,7 @@ public:
void ARMDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DEBUG(BB->dump());
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
DAG.RemoveDeadNodes();
}

View File

@ -236,7 +236,7 @@ void AlphaDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DEBUG(BB->dump());
// Select target instructions for the DAG.
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
DAG.RemoveDeadNodes();
}

View File

@ -347,7 +347,7 @@ SPUDAGToDAGISel::InstructionSelect(SelectionDAG &DAG)
DEBUG(BB->dump());
// Select target instructions for the DAG.
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
DAG.RemoveDeadNodes();
}

View File

@ -100,7 +100,7 @@ void IA64DAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DEBUG(BB->dump());
// Select target instructions for the DAG.
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
DAG.RemoveDeadNodes();
}

View File

@ -113,7 +113,7 @@ InstructionSelect(SelectionDAG &SD)
#endif
// Select target instructions for the DAG.
SD.setRoot(SelectRoot(SD.getRoot()));
SelectRoot();
#ifndef NDEBUG
DOUT << "===== Instruction selection ends:\n";

View File

@ -109,7 +109,7 @@ void PIC16DAGToDAGISel::InstructionSelect(SelectionDAG &SD)
#endif
// Select target instructions for the DAG.
SD.setRoot(SelectRoot(SD.getRoot()));
SelectRoot();
DOUT << "===== Instruction selection ends:\n";

View File

@ -207,7 +207,7 @@ void PPCDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DEBUG(BB->dump());
// Select target instructions for the DAG.
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
DAG.RemoveDeadNodes();
}

View File

@ -66,7 +66,7 @@ void SparcDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DEBUG(BB->dump());
// Select target instructions for the DAG.
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
DAG.RemoveDeadNodes();
}

View File

@ -592,7 +592,7 @@ void X86DAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DOUT << "===== Instruction selection begins:\n";
Indent = 0;
#endif
DAG.setRoot(SelectRoot(DAG.getRoot()));
SelectRoot();
#ifndef NDEBUG
DOUT << "===== Instruction selection ends:\n";
#endif