Revert r150288, "Allow Post-RA LICM to hoist reserved register reads."
[oota-llvm.git] / lib / CodeGen / MachineLICM.cpp
index 47eb685db3cd5e36dcf55b5ee4ad771535effcfe..fda60563ed4058c219267fa51e7f1f0d1897490c 100644 (file)
@@ -68,7 +68,6 @@ namespace {
     MachineRegisterInfo *MRI;
     const InstrItineraryData *InstrItins;
     bool PreRegAlloc;
-    BitVector ReservedRegs;
 
     // Various analyses that we use...
     AliasAnalysis        *AA;      // Alias analysis info.
@@ -338,8 +337,6 @@ bool MachineLICM::runOnMachineFunction(MachineFunction &MF) {
     for (TargetRegisterInfo::regclass_iterator I = TRI->regclass_begin(),
            E = TRI->regclass_end(); I != E; ++I)
       RegLimit[(*I)->getID()] = TRI->getRegPressureLimit(*I, MF);
-  } else {
-    ReservedRegs = TRI->getReservedRegs(MF);
   }
 
   // Get our Loop information...
@@ -429,9 +426,6 @@ void MachineLICM::ProcessMI(MachineInstr *MI,
            "Not expecting virtual register!");
 
     if (!MO.isDef()) {
-      // Allow reserved register reads to be hoisted.
-      if (ReservedRegs.test(Reg))
-        continue;
       if (Reg && (PhysRegDefs.test(Reg) || PhysRegClobbers.test(Reg)))
         // If it's using a non-loop-invariant register, then it's obviously not
         // safe to hoist.
@@ -537,11 +531,6 @@ void MachineLICM::HoistRegionPostRA() {
         const MachineOperand &MO = MI->getOperand(j);
         if (!MO.isReg() || MO.isDef() || !MO.getReg())
           continue;
-        // Allow hoisting of reserved register reads that aren't call preserved.
-        // For example %rip.
-        // IsLoopInvariantInst() already checks MRI->isConstantPhysReg().
-        if (ReservedRegs.test(MO.getReg()))
-          continue;
         if (PhysRegDefs.test(MO.getReg()) ||
             PhysRegClobbers.test(MO.getReg())) {
           // If it's using a non-loop-invariant register, then it's obviously