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
diff --git a/lib/Target/ARM/ARMISelDAGToDAG.cpp b/lib/Target/ARM/ARMISelDAGToDAG.cpp
index b79fffe..ad1f63d 100644
--- a/lib/Target/ARM/ARMISelDAGToDAG.cpp
+++ b/lib/Target/ARM/ARMISelDAGToDAG.cpp
@@ -94,7 +94,7 @@
void ARMDAGToDAGISel::InstructionSelect(SelectionDAG &DAG) {
DEBUG(BB->dump());
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
DAG.RemoveDeadNodes();
}
diff --git a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
index 89dee2a..0ff735d 100644
--- a/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
+++ b/lib/Target/Alpha/AlphaISelDAGToDAG.cpp
@@ -236,7 +236,7 @@
DEBUG(BB->dump());
// Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
DAG.RemoveDeadNodes();
}
diff --git a/lib/Target/CellSPU/SPUISelDAGToDAG.cpp b/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
index 84a1bd8..c8d04b4 100644
--- a/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
+++ b/lib/Target/CellSPU/SPUISelDAGToDAG.cpp
@@ -347,7 +347,7 @@
DEBUG(BB->dump());
// Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
DAG.RemoveDeadNodes();
}
diff --git a/lib/Target/IA64/IA64ISelDAGToDAG.cpp b/lib/Target/IA64/IA64ISelDAGToDAG.cpp
index c5c3114..8173e96 100644
--- a/lib/Target/IA64/IA64ISelDAGToDAG.cpp
+++ b/lib/Target/IA64/IA64ISelDAGToDAG.cpp
@@ -100,7 +100,7 @@
DEBUG(BB->dump());
// Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
DAG.RemoveDeadNodes();
}
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp
index f463d3a..94fdb35 100644
--- a/lib/Target/Mips/MipsISelDAGToDAG.cpp
+++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp
@@ -113,7 +113,7 @@
#endif
// Select target instructions for the DAG.
- SD.setRoot(SelectRoot(SD.getRoot()));
+ SelectRoot();
#ifndef NDEBUG
DOUT << "===== Instruction selection ends:\n";
diff --git a/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp b/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp
index ba002bd..f1eaa39 100644
--- a/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp
+++ b/lib/Target/PIC16/PIC16ISelDAGToDAG.cpp
@@ -109,7 +109,7 @@
#endif
// Select target instructions for the DAG.
- SD.setRoot(SelectRoot(SD.getRoot()));
+ SelectRoot();
DOUT << "===== Instruction selection ends:\n";
diff --git a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
index 65ab4d2..c647955 100644
--- a/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ b/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -207,7 +207,7 @@
DEBUG(BB->dump());
// Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
DAG.RemoveDeadNodes();
}
diff --git a/lib/Target/Sparc/SparcISelDAGToDAG.cpp b/lib/Target/Sparc/SparcISelDAGToDAG.cpp
index 7d2d11e..f623873 100644
--- a/lib/Target/Sparc/SparcISelDAGToDAG.cpp
+++ b/lib/Target/Sparc/SparcISelDAGToDAG.cpp
@@ -66,7 +66,7 @@
DEBUG(BB->dump());
// Select target instructions for the DAG.
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
DAG.RemoveDeadNodes();
}
diff --git a/lib/Target/X86/X86ISelDAGToDAG.cpp b/lib/Target/X86/X86ISelDAGToDAG.cpp
index 13ed07c..21837d5 100644
--- a/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -592,7 +592,7 @@
DOUT << "===== Instruction selection begins:\n";
Indent = 0;
#endif
- DAG.setRoot(SelectRoot(DAG.getRoot()));
+ SelectRoot();
#ifndef NDEBUG
DOUT << "===== Instruction selection ends:\n";
#endif