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