Remove the TargetMachine forwards for TargetSubtargetInfo based

information and update all callers. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214781 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2014-08-04 21:25:23 +00:00
parent ffa13eafbf
commit 9f85dccfc6
297 changed files with 2215 additions and 1721 deletions

View File

@ -78,6 +78,7 @@
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetInstrInfo.h"
#include "llvm/Target/TargetRegisterInfo.h"
#include "llvm/Target/TargetSubtargetInfo.h"
using namespace llvm;
#define DEBUG_TYPE "peephole-opt"
@ -277,7 +278,8 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
// Ensure DstReg can get a register class that actually supports
// sub-registers. Don't change the class until we commit.
const TargetRegisterClass *DstRC = MRI->getRegClass(DstReg);
DstRC = TM->getRegisterInfo()->getSubClassWithSubReg(DstRC, SubIdx);
DstRC = TM->getSubtargetImpl()->getRegisterInfo()->getSubClassWithSubReg(
DstRC, SubIdx);
if (!DstRC)
return false;
@ -286,8 +288,9 @@ optimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
// register.
// If UseSrcSubIdx is Set, SubIdx also applies to SrcReg, and only uses of
// SrcReg:SubIdx should be replaced.
bool UseSrcSubIdx = TM->getRegisterInfo()->
getSubClassWithSubReg(MRI->getRegClass(SrcReg), SubIdx) != nullptr;
bool UseSrcSubIdx =
TM->getSubtargetImpl()->getRegisterInfo()->getSubClassWithSubReg(
MRI->getRegClass(SrcReg), SubIdx) != nullptr;
// The source has other uses. See if we can replace the other uses with use of
// the result of the extension.
@ -546,7 +549,7 @@ bool PeepholeOptimizer::optimizeCopyOrBitcast(MachineInstr *MI) {
unsigned Src;
unsigned SrcSubReg;
bool ShouldRewrite = false;
const TargetRegisterInfo &TRI = *TM->getRegisterInfo();
const TargetRegisterInfo &TRI = *TM->getSubtargetImpl()->getRegisterInfo();
// Follow the chain of copies until we reach the top of the use-def chain
// or find a more suitable source.
@ -674,7 +677,7 @@ bool PeepholeOptimizer::runOnMachineFunction(MachineFunction &MF) {
return false;
TM = &MF.getTarget();
TII = TM->getInstrInfo();
TII = TM->getSubtargetImpl()->getInstrInfo();
MRI = &MF.getRegInfo();
DT = Aggressive ? &getAnalysis<MachineDominatorTree>() : nullptr;