diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-06-07 20:35:25 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-06-07 20:35:25 +0000 |
commit | c1dcb8d654d4468d63224269ee3c92480bf2385b (patch) | |
tree | 8b0fb75e23335957db8d6889ee0be7a445f5d4f5 /lib/Target/Sparc/DelaySlotFiller.cpp | |
parent | 8b0f77bb96353bf43c3bb0ad6fba8911eacc9989 (diff) | |
download | llvm-c1dcb8d654d4468d63224269ee3c92480bf2385b.tar.gz llvm-c1dcb8d654d4468d63224269ee3c92480bf2385b.tar.bz2 llvm-c1dcb8d654d4468d63224269ee3c92480bf2385b.tar.xz |
Don't cache the instruction and register info from the TargetMachine, because
the internals of TargetMachine could change.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183565 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Sparc/DelaySlotFiller.cpp')
-rw-r--r-- | lib/Target/Sparc/DelaySlotFiller.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Target/Sparc/DelaySlotFiller.cpp b/lib/Target/Sparc/DelaySlotFiller.cpp index 5ec54a6a84..b93f5e4d7a 100644 --- a/lib/Target/Sparc/DelaySlotFiller.cpp +++ b/lib/Target/Sparc/DelaySlotFiller.cpp @@ -39,11 +39,10 @@ namespace { /// layout, etc. /// TargetMachine &TM; - const TargetInstrInfo *TII; static char ID; Filler(TargetMachine &tm) - : MachineFunctionPass(ID), TM(tm), TII(tm.getInstrInfo()) { } + : MachineFunctionPass(ID), TM(tm) { } virtual const char *getPassName() const { return "SPARC Delay Slot Filler"; @@ -127,6 +126,7 @@ bool Filler::runOnMachineBasicBlock(MachineBasicBlock &MBB) { ++FilledSlots; Changed = true; + const TargetInstrInfo *TII = TM.getInstrInfo(); if (D == MBB.end()) BuildMI(MBB, I, MI->getDebugLoc(), TII->get(SP::NOP)); else @@ -166,7 +166,7 @@ Filler::findDelayInstr(MachineBasicBlock &MBB, if (J->getOpcode() == SP::RESTORErr || J->getOpcode() == SP::RESTOREri) { // change retl to ret. - slot->setDesc(TII->get(SP::RET)); + slot->setDesc(TM.getInstrInfo()->get(SP::RET)); return J; } } @@ -476,6 +476,8 @@ bool Filler::tryCombineRestoreWithPrevInst(MachineBasicBlock &MBB, if (isDelayFiller(MBB, PrevInst)) return false; + const TargetInstrInfo *TII = TM.getInstrInfo(); + switch (PrevInst->getOpcode()) { default: break; case SP::ADDrr: |