MachineRegisterInfo can access TII off of the MachineFunction's
authorEric Christopher <echristo@gmail.com>
Tue, 27 Jan 2015 01:15:16 +0000 (01:15 +0000)
committerEric Christopher <echristo@gmail.com>
Tue, 27 Jan 2015 01:15:16 +0000 (01:15 +0000)
subtarget and so doesn't need the TargetMachine or to access via
getSubtargetImpl. Update all callers.

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

include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/LiveRangeEdit.cpp
lib/CodeGen/MachineRegisterInfo.cpp
lib/CodeGen/RegisterCoalescer.cpp

index caa48a5cf0cfcc4bc07e0e4c576f3b5dfc7e816c..6eb3bed30ae7e65431f1b38be5ae315e160b68e5 100644 (file)
@@ -593,7 +593,7 @@ public:
   /// virtual register, for example after removing instructions or splitting
   /// the live range.
   ///
-  bool recomputeRegClass(unsigned Reg, const TargetMachine&);
+  bool recomputeRegClass(unsigned Reg);
 
   /// createVirtualRegister - Create and return a new virtual register in the
   /// function with the specified register class.
index 189da65962601d4f0dfc155b242d9b758c063f4e..0edc897dc316aa65a2bb6f6a7e202698261d90b0 100644 (file)
@@ -399,7 +399,7 @@ LiveRangeEdit::calculateRegClassAndHint(MachineFunction &MF,
   VirtRegAuxInfo VRAI(MF, LIS, Loops, MBFI);
   for (unsigned I = 0, Size = size(); I < Size; ++I) {
     LiveInterval &LI = LIS.getInterval(get(I));
-    if (MRI.recomputeRegClass(LI.reg, MF.getTarget()))
+    if (MRI.recomputeRegClass(LI.reg))
       DEBUG({
         const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
         dbgs() << "Inflated " << PrintReg(LI.reg) << " to "
index 86bb34be3fe897510de3b0d9e7deb32aa5609faa..32b7db102835ac3271e16b3ad3ca43ab4d761f36 100644 (file)
@@ -61,8 +61,8 @@ MachineRegisterInfo::constrainRegClass(unsigned Reg,
 }
 
 bool
-MachineRegisterInfo::recomputeRegClass(unsigned Reg, const TargetMachine &TM) {
-  const TargetInstrInfo *TII = TM.getSubtargetImpl()->getInstrInfo();
+MachineRegisterInfo::recomputeRegClass(unsigned Reg) {
+  const TargetInstrInfo *TII = MF->getSubtarget().getInstrInfo();
   const TargetRegisterClass *OldRC = getRegClass(Reg);
   const TargetRegisterClass *NewRC =
     getTargetRegisterInfo()->getLargestLegalSuperClass(OldRC);
index c136916dc27c46fc007b268a61130d94bf4cfa44..a67017eeec922c16e94e15c8733d3a0380713960 100644 (file)
@@ -2756,7 +2756,7 @@ bool RegisterCoalescer::runOnMachineFunction(MachineFunction &fn) {
     unsigned Reg = InflateRegs[i];
     if (MRI->reg_nodbg_empty(Reg))
       continue;
-    if (MRI->recomputeRegClass(Reg, *TM)) {
+    if (MRI->recomputeRegClass(Reg)) {
       DEBUG(dbgs() << PrintReg(Reg) << " inflated to "
                    << TRI->getRegClassName(MRI->getRegClass(Reg)) << '\n');
       LiveInterval &LI = LIS->getInterval(Reg);