Have SelectionDAG's subtarget TargetSelectionDAGInfo be set
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAG.cpp
index 2322ce0104c563e921c51e21ee2c2c1a1fd66ced..25532ec1ba77ac5bb5e5dd0d19f646548d9de76e 100644 (file)
@@ -907,8 +907,7 @@ unsigned SelectionDAG::getEVTAlignment(EVT VT) const {
 
 // EntryNode could meaningfully have debug info if we can find it...
 SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOpt::Level OL)
 
 // EntryNode could meaningfully have debug info if we can find it...
 SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOpt::Level OL)
-    : TM(tm), TSI(tm.getSubtargetImpl()->getSelectionDAGInfo()), TLI(nullptr),
-      OptLevel(OL),
+    : TM(tm), TSI(nullptr), TLI(nullptr), OptLevel(OL),
       EntryNode(ISD::EntryToken, 0, DebugLoc(), getVTList(MVT::Other)),
       Root(getEntryNode()), NewNodesMustHaveLegalTypes(false),
       UpdateListeners(nullptr) {
       EntryNode(ISD::EntryToken, 0, DebugLoc(), getVTList(MVT::Other)),
       Root(getEntryNode()), NewNodesMustHaveLegalTypes(false),
       UpdateListeners(nullptr) {
@@ -919,6 +918,7 @@ SelectionDAG::SelectionDAG(const TargetMachine &tm, CodeGenOpt::Level OL)
 void SelectionDAG::init(MachineFunction &mf, const TargetLowering *tli) {
   MF = &mf;
   TLI = tli;
 void SelectionDAG::init(MachineFunction &mf, const TargetLowering *tli) {
   MF = &mf;
   TLI = tli;
+  TSI = getSubtarget().getSelectionDAGInfo();
   Context = &mf.getFunction()->getContext();
 }
 
   Context = &mf.getFunction()->getContext();
 }