diff options
author | Eric Christopher <echristo@gmail.com> | 2014-08-05 02:39:49 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2014-08-05 02:39:49 +0000 |
commit | fc6de428c8ab10330e1b00c6541503cfd98a9cca (patch) | |
tree | a2f2e256682f7ec9c6affef81490a88327f6844c /llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp | |
parent | 5beccb22bc151a6711e28a893ed1446ccae7ba13 (diff) | |
download | bcm5719-llvm-fc6de428c8ab10330e1b00c6541503cfd98a9cca.tar.gz bcm5719-llvm-fc6de428c8ab10330e1b00c6541503cfd98a9cca.zip |
Have MachineFunction cache a pointer to the subtarget to make lookups
shorter/easier and have the DAG use that to do the same lookup. This
can be used in the future for TargetMachine based caching lookups from
the MachineFunction easily.
Update the MIPS subtarget switching machinery to update this pointer
at the same time it runs.
llvm-svn: 214838
Diffstat (limited to 'llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp')
-rw-r--r-- | llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp index ba318023c24..64f5eebf37c 100644 --- a/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp +++ b/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp @@ -35,8 +35,7 @@ SystemZRegisterInfo::getCallPreservedMask(CallingConv::ID CC) const { BitVector SystemZRegisterInfo::getReservedRegs(const MachineFunction &MF) const { BitVector Reserved(getNumRegs()); - const TargetFrameLowering *TFI = - MF.getTarget().getSubtargetImpl()->getFrameLowering(); + const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering(); if (TFI->hasFP(MF)) { // R11D is the frame pointer. Reserve all aliases. @@ -62,10 +61,9 @@ SystemZRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI, MachineBasicBlock &MBB = *MI->getParent(); MachineFunction &MF = *MBB.getParent(); - auto *TII = static_cast<const SystemZInstrInfo *>( - MF.getTarget().getSubtargetImpl()->getInstrInfo()); - const TargetFrameLowering *TFI = - MF.getTarget().getSubtargetImpl()->getFrameLowering(); + auto *TII = + static_cast<const SystemZInstrInfo *>(MF.getSubtarget().getInstrInfo()); + const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering(); DebugLoc DL = MI->getDebugLoc(); // Decompose the frame index into a base and offset. @@ -136,7 +134,6 @@ SystemZRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator MI, unsigned SystemZRegisterInfo::getFrameRegister(const MachineFunction &MF) const { - const TargetFrameLowering *TFI = - MF.getTarget().getSubtargetImpl()->getFrameLowering(); + const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering(); return TFI->hasFP(MF) ? SystemZ::R11D : SystemZ::R15D; } |