InstrItineraryData is already on the subtarget, no reason to
authorEric Christopher <echristo@gmail.com>
Fri, 27 Jun 2014 00:13:43 +0000 (00:13 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 27 Jun 2014 00:13:43 +0000 (00:13 +0000)
cache it on the target as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211818 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/Hexagon/HexagonTargetMachine.cpp
lib/Target/Hexagon/HexagonTargetMachine.h

index b923764..c3caa91 100644 (file)
@@ -67,15 +67,12 @@ SchedCustomRegistry("hexagon", "Run Hexagon's custom scheduler",
 HexagonTargetMachine::HexagonTargetMachine(const Target &T, StringRef TT,
                                            StringRef CPU, StringRef FS,
                                            const TargetOptions &Options,
-                                           Reloc::Model RM,
-                                           CodeModel::Model CM,
+                                           Reloc::Model RM, CodeModel::Model CM,
                                            CodeGenOpt::Level OL)
-  : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
-    DL("e-m:e-p:32:32-i1:32-i64:64-a:0-n32") ,
-    Subtarget(TT, CPU, FS), InstrInfo(Subtarget), TLInfo(*this),
-    TSInfo(*this),
-    FrameLowering(Subtarget),
-    InstrItins(&Subtarget.getInstrItineraryData()) {
+    : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
+      DL("e-m:e-p:32:32-i1:32-i64:64-a:0-n32"), Subtarget(TT, CPU, FS),
+      InstrInfo(Subtarget), TLInfo(*this), TSInfo(*this),
+      FrameLowering(Subtarget) {
     initAsmInfo();
 }
 
index 70b835e..fa7b6d4 100644 (file)
@@ -33,7 +33,6 @@ class HexagonTargetMachine : public LLVMTargetMachine {
   HexagonTargetLowering TLInfo;
   HexagonSelectionDAGInfo TSInfo;
   HexagonFrameLowering FrameLowering;
-  const InstrItineraryData* InstrItins;
 
 public:
   HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU,
@@ -52,7 +51,7 @@ public:
   }
 
   const InstrItineraryData* getInstrItineraryData() const override {
-    return InstrItins;
+    return &getSubtargetImpl()->getInstrItineraryData();
   }