Override runOnMachineFunction for X86ISelDAGToDAG so that we can
authorEric Christopher <echristo@gmail.com>
Thu, 22 May 2014 01:53:26 +0000 (01:53 +0000)
committerEric Christopher <echristo@gmail.com>
Thu, 22 May 2014 01:53:26 +0000 (01:53 +0000)
reset the subtarget on each function.

llvm-svn: 209384

llvm/lib/Target/X86/X86ISelDAGToDAG.cpp

index 03c9620..74386d3 100644 (file)
@@ -162,6 +162,13 @@ namespace {
       return "X86 DAG->DAG Instruction Selection";
     }
 
+    bool runOnMachineFunction(MachineFunction &MF) override {
+      // Reset the subtarget each time through.
+      Subtarget = &TM.getSubtarget<X86Subtarget>();
+      SelectionDAGISel::runOnMachineFunction(MF);
+      return true;
+    }
+
     void EmitFunctionEntryCode() override;
 
     bool IsProfitableToFold(SDValue N, SDNode *U, SDNode *Root) const override;