mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-23 11:38:38 +00:00
Simplify SelectRoot's interface, and factor out some common code
from all targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55124 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
ca84121596
commit
ad3460c3c9
@ -153,7 +153,7 @@ void ReplaceUses(SDNode *F, SDNode *T) DISABLE_INLINE {
|
|||||||
|
|
||||||
/// SelectRoot - Top level entry to DAG instruction selector.
|
/// SelectRoot - Top level entry to DAG instruction selector.
|
||||||
/// Selects instructions starting at the root of the current DAG.
|
/// Selects instructions starting at the root of the current DAG.
|
||||||
SDValue SelectRoot(SDValue Root) {
|
void SelectRoot() {
|
||||||
SelectRootInit();
|
SelectRootInit();
|
||||||
unsigned NumBytes = (DAGSize + 7) / 8;
|
unsigned NumBytes = (DAGSize + 7) / 8;
|
||||||
ISelQueued = new unsigned char[NumBytes];
|
ISelQueued = new unsigned char[NumBytes];
|
||||||
@ -197,7 +197,7 @@ SDValue SelectRoot(SDValue Root) {
|
|||||||
ISelQueued = NULL;
|
ISelQueued = NULL;
|
||||||
delete[] ISelSelected;
|
delete[] ISelSelected;
|
||||||
ISelSelected = NULL;
|
ISelSelected = NULL;
|
||||||
return Dummy.getValue();
|
CurDAG->setRoot(Dummy.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* LLVM_CODEGEN_DAGISEL_HEADER_H */
|
#endif /* LLVM_CODEGEN_DAGISEL_HEADER_H */
|
||||||
|
@ -94,7 +94,7 @@ public:
|
|||||||
void ARMDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
void ARMDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
||||||
DEBUG(BB->dump());
|
DEBUG(BB->dump());
|
||||||
|
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
DAG.RemoveDeadNodes();
|
DAG.RemoveDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +236,7 @@ void AlphaDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
|||||||
DEBUG(BB->dump());
|
DEBUG(BB->dump());
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
DAG.RemoveDeadNodes();
|
DAG.RemoveDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -347,7 +347,7 @@ SPUDAGToDAGISel::InstructionSelect(SelectionDAG &DAG)
|
|||||||
DEBUG(BB->dump());
|
DEBUG(BB->dump());
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
DAG.RemoveDeadNodes();
|
DAG.RemoveDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ void IA64DAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
|||||||
DEBUG(BB->dump());
|
DEBUG(BB->dump());
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
DAG.RemoveDeadNodes();
|
DAG.RemoveDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ InstructionSelect(SelectionDAG &SD)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
SD.setRoot(SelectRoot(SD.getRoot()));
|
SelectRoot();
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DOUT << "===== Instruction selection ends:\n";
|
DOUT << "===== Instruction selection ends:\n";
|
||||||
|
@ -109,7 +109,7 @@ void PIC16DAGToDAGISel::InstructionSelect(SelectionDAG &SD)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
SD.setRoot(SelectRoot(SD.getRoot()));
|
SelectRoot();
|
||||||
|
|
||||||
DOUT << "===== Instruction selection ends:\n";
|
DOUT << "===== Instruction selection ends:\n";
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ void PPCDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
|||||||
DEBUG(BB->dump());
|
DEBUG(BB->dump());
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
DAG.RemoveDeadNodes();
|
DAG.RemoveDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ void SparcDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
|||||||
DEBUG(BB->dump());
|
DEBUG(BB->dump());
|
||||||
|
|
||||||
// Select target instructions for the DAG.
|
// Select target instructions for the DAG.
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
DAG.RemoveDeadNodes();
|
DAG.RemoveDeadNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -592,7 +592,7 @@ void X86DAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
|
|||||||
DOUT << "===== Instruction selection begins:\n";
|
DOUT << "===== Instruction selection begins:\n";
|
||||||
Indent = 0;
|
Indent = 0;
|
||||||
#endif
|
#endif
|
||||||
DAG.setRoot(SelectRoot(DAG.getRoot()));
|
SelectRoot();
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
DOUT << "===== Instruction selection ends:\n";
|
DOUT << "===== Instruction selection ends:\n";
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user