forked from OSchip/llvm-project
[SelectionDAGISel] Add a debug print before call to Select. Adjust where blank lines are printed during isel process to make things more sensibly grouped.
Previously some targets printed their own message at the start of Select to indicate what they were selecting. For the targets that didn't, it means there was no print of the root node before any custom handling in the target executed. So if the target did something custom and never called SelectNodeCommon, no print would be made. For the targets that did print a message in Select, if they didn't custom handle a node SelectNodeCommon would reprint the root node before walking the isel table. It seems better to just print the message before the call to Select so all targets behave the same. And then remove the root node printing from SelectNodeCommon and just leave a message that says we're starting the table search. There were also some oddities in blank line behavior. Usually due to a \n after a call to SelectionDAGNode::dump which already inserted a new line. llvm-svn: 323551
This commit is contained in:
parent
b207dd6870
commit
8f324bb1a4
|
@ -985,13 +985,16 @@ void SelectionDAGISel::DoInstructionSelection() {
|
|||
if (Node->isStrictFPOpcode())
|
||||
Node = CurDAG->mutateStrictFPToFP(Node);
|
||||
|
||||
DEBUG(dbgs() << "\nISEL: Starting selection on root node: ";
|
||||
Node->dump(CurDAG));
|
||||
|
||||
Select(Node);
|
||||
}
|
||||
|
||||
CurDAG->setRoot(Dummy.getValue());
|
||||
}
|
||||
|
||||
DEBUG(dbgs() << "===== Instruction selection ends:\n");
|
||||
DEBUG(dbgs() << "\n===== Instruction selection ends:\n");
|
||||
|
||||
PostprocessISelDAG();
|
||||
}
|
||||
|
@ -2988,9 +2991,7 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
|
|||
// update the chain results when the pattern is complete.
|
||||
SmallVector<SDNode*, 3> ChainNodesMatched;
|
||||
|
||||
DEBUG(dbgs() << "ISEL: Starting pattern match on root node: ";
|
||||
NodeToMatch->dump(CurDAG);
|
||||
dbgs() << '\n');
|
||||
DEBUG(dbgs() << "ISEL: Starting pattern match\n");
|
||||
|
||||
// Determine where to start the interpreter. Normally we start at opcode #0,
|
||||
// but if the state machine starts with an OPC_SwitchOpcode, then we
|
||||
|
@ -3665,8 +3666,6 @@ void SelectionDAGISel::SelectCodeCommon(SDNode *NodeToMatch,
|
|||
<< (IsMorphNodeTo ? "Morphed" : "Created")
|
||||
<< " node: ";
|
||||
Res->dump(CurDAG);
|
||||
|
||||
dbgs() << '\n';
|
||||
);
|
||||
|
||||
// If this was a MorphNodeTo then we're completely done!
|
||||
|
|
|
@ -2653,11 +2653,6 @@ bool AArch64DAGToDAGISel::SelectCMP_SWAP(SDNode *N) {
|
|||
}
|
||||
|
||||
void AArch64DAGToDAGISel::Select(SDNode *Node) {
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: ");
|
||||
DEBUG(Node->dump(CurDAG));
|
||||
DEBUG(errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -519,9 +519,6 @@ bool AVRDAGToDAGISel::selectMultiplication(llvm::SDNode *N) {
|
|||
}
|
||||
|
||||
void AVRDAGToDAGISel::Select(SDNode *N) {
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: "; N->dump(CurDAG); errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (N->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; N->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -176,9 +176,6 @@ bool BPFDAGToDAGISel::SelectInlineAsmMemoryOperand(
|
|||
void BPFDAGToDAGISel::Select(SDNode *Node) {
|
||||
unsigned Opcode = Node->getOpcode();
|
||||
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(dbgs() << "Selecting: "; Node->dump(CurDAG); dbgs() << '\n');
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << '\n');
|
||||
|
|
|
@ -273,9 +273,6 @@ bool LanaiDAGToDAGISel::SelectInlineAsmMemoryOperand(
|
|||
void LanaiDAGToDAGISel::Select(SDNode *Node) {
|
||||
unsigned Opcode = Node->getOpcode();
|
||||
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -381,11 +381,6 @@ bool MSP430DAGToDAGISel::tryIndexedBinOp(SDNode *Op, SDValue N1, SDValue N2,
|
|||
void MSP430DAGToDAGISel::Select(SDNode *Node) {
|
||||
SDLoc dl(Node);
|
||||
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: ");
|
||||
DEBUG(Node->dump(CurDAG));
|
||||
DEBUG(errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== ";
|
||||
|
|
|
@ -215,9 +215,6 @@ bool MipsDAGToDAGISel::selectVSplatMaskR(SDValue N, SDValue &Imm) const {
|
|||
void MipsDAGToDAGISel::Select(SDNode *Node) {
|
||||
unsigned Opcode = Node->getOpcode();
|
||||
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -59,9 +59,6 @@ public:
|
|||
// expanded, promoted and normal instructions
|
||||
void Nios2DAGToDAGISel::Select(SDNode *Node) {
|
||||
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -58,9 +58,6 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
|
|||
unsigned Opcode = Node->getOpcode();
|
||||
MVT XLenVT = Subtarget->getXLenVT();
|
||||
|
||||
// Dump information about the Node being selected.
|
||||
DEBUG(dbgs() << "Selecting: "; Node->dump(CurDAG); dbgs() << "\n");
|
||||
|
||||
// If we have a custom node, we have already selected
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << "\n");
|
||||
|
|
|
@ -1249,9 +1249,6 @@ bool SystemZDAGToDAGISel::storeLoadCanUseBlockBinary(SDNode *N,
|
|||
}
|
||||
|
||||
void SystemZDAGToDAGISel::Select(SDNode *Node) {
|
||||
// Dump information about the Node being selected
|
||||
DEBUG(errs() << "Selecting: "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -68,11 +68,6 @@ private:
|
|||
} // end anonymous namespace
|
||||
|
||||
void WebAssemblyDAGToDAGISel::Select(SDNode *Node) {
|
||||
// Dump information about the Node being selected.
|
||||
DEBUG(errs() << "Selecting: ");
|
||||
DEBUG(Node->dump(CurDAG));
|
||||
DEBUG(errs() << "\n");
|
||||
|
||||
// If we have a custom node, we already have selected!
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(errs() << "== "; Node->dump(CurDAG); errs() << "\n");
|
||||
|
|
|
@ -2519,8 +2519,6 @@ void X86DAGToDAGISel::Select(SDNode *Node) {
|
|||
unsigned Opcode = Node->getOpcode();
|
||||
SDLoc dl(Node);
|
||||
|
||||
DEBUG(dbgs() << "Selecting: "; Node->dump(CurDAG); dbgs() << '\n');
|
||||
|
||||
if (Node->isMachineOpcode()) {
|
||||
DEBUG(dbgs() << "== "; Node->dump(CurDAG); dbgs() << '\n');
|
||||
Node->setNodeId(-1);
|
||||
|
|
Loading…
Reference in New Issue