Remove the cached InstrItineraryData on the TargetMachine, it's unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@212149 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher 2014-07-02 00:54:07 +00:00
parent 6dfd006fcf
commit fe1686d29a
2 changed files with 13 additions and 15 deletions

View File

@ -80,19 +80,16 @@ static std::string computeDataLayout(const MipsSubtarget &ST) {
// offset from the stack/frame pointer, using StackGrowsUp enables // offset from the stack/frame pointer, using StackGrowsUp enables
// an easier handling. // an easier handling.
// Using CodeModel::Large enables different CALL behavior. // Using CodeModel::Large enables different CALL behavior.
MipsTargetMachine:: MipsTargetMachine::MipsTargetMachine(const Target &T, StringRef TT,
MipsTargetMachine(const Target &T, StringRef TT, StringRef CPU, StringRef FS,
StringRef CPU, StringRef FS, const TargetOptions &Options, const TargetOptions &Options,
Reloc::Model RM, CodeModel::Model CM, Reloc::Model RM, CodeModel::Model CM,
CodeGenOpt::Level OL, CodeGenOpt::Level OL, bool isLittle)
bool isLittle)
: LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL), : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
Subtarget(TT, CPU, FS, isLittle, RM, this), Subtarget(TT, CPU, FS, isLittle, RM, this),
DL(computeDataLayout(Subtarget)), DL(computeDataLayout(Subtarget)), InstrInfo(MipsInstrInfo::create(*this)),
InstrInfo(MipsInstrInfo::create(*this)),
FrameLowering(MipsFrameLowering::create(*this, Subtarget)), FrameLowering(MipsFrameLowering::create(*this, Subtarget)),
TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL), TLInfo(MipsTargetLowering::create(*this)), TSInfo(DL), JITInfo() {
InstrItins(Subtarget.getInstrItineraryData()), JITInfo() {
initAsmInfo(); initAsmInfo();
} }

View File

@ -43,7 +43,6 @@ class MipsTargetMachine : public LLVMTargetMachine {
std::unique_ptr<const MipsFrameLowering> FrameLoweringSE; std::unique_ptr<const MipsFrameLowering> FrameLoweringSE;
std::unique_ptr<const MipsTargetLowering> TLInfoSE; std::unique_ptr<const MipsTargetLowering> TLInfoSE;
MipsSelectionDAGInfo TSInfo; MipsSelectionDAGInfo TSInfo;
const InstrItineraryData &InstrItins;
MipsJITInfo JITInfo; MipsJITInfo JITInfo;
public: public:
@ -67,7 +66,9 @@ public:
{ return &DL;} { return &DL;}
const InstrItineraryData *getInstrItineraryData() const override { const InstrItineraryData *getInstrItineraryData() const override {
return Subtarget.inMips16Mode() ? nullptr : &InstrItins; return Subtarget.inMips16Mode()
? nullptr
: &getSubtargetImpl()->getInstrItineraryData();
} }
MipsJITInfo *getJITInfo() override { return &JITInfo; } MipsJITInfo *getJITInfo() override { return &JITInfo; }