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/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";