[llvm] r303955 - Revert "LivePhysRegs: Skip reserved regs in computeLiveIns; NFCI"

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 18:29:32 PDT 2017


Author: matze
Date: Thu May 25 20:29:32 2017
New Revision: 303955

URL: http://llvm.org/viewvc/llvm-project?rev=303955&view=rev
Log:
Revert "LivePhysRegs: Skip reserved regs in computeLiveIns; NFCI"

Tentatively revert, suspecting that it caused breakage in stage2
buildbots.

This reverts commit r303949.
This reverts commit r303937.

Modified:
    llvm/trunk/include/llvm/CodeGen/LivePhysRegs.h
    llvm/trunk/lib/CodeGen/BranchFolding.cpp
    llvm/trunk/lib/CodeGen/BranchFolding.h
    llvm/trunk/lib/CodeGen/BranchRelaxation.cpp
    llvm/trunk/lib/CodeGen/LivePhysRegs.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LivePhysRegs.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LivePhysRegs.h?rev=303955&r1=303954&r2=303955&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LivePhysRegs.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LivePhysRegs.h Thu May 25 20:29:32 2017
@@ -163,7 +163,7 @@ inline raw_ostream &operator<<(raw_ostre
 /// lists are up-to-date. Uses the given LivePhysReg instance \p LiveRegs; This
 /// is just here to avoid repeated heap allocations when calling this multiple
 /// times in a pass.
-void computeLiveIns(LivePhysRegs &LiveRegs, const MachineRegisterInfo &MRI,
+void computeLiveIns(LivePhysRegs &LiveRegs, const TargetRegisterInfo &TRI,
                     MachineBasicBlock &MBB);
 
 } // end namespace llvm

Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=303955&r1=303954&r2=303955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Thu May 25 20:29:32 2017
@@ -153,14 +153,13 @@ bool BranchFolder::OptimizeFunction(Mach
 
   TriedMerging.clear();
 
-  MachineRegisterInfo &MRI = MF.getRegInfo();
   AfterBlockPlacement = AfterPlacement;
   TII = tii;
   TRI = tri;
   MMI = mmi;
   MLI = mli;
-  this->MRI = &MRI;
 
+  MachineRegisterInfo &MRI = MF.getRegInfo();
   UpdateLiveIns = MRI.tracksLiveness() && TRI->trackLivenessAfterRegAlloc(MF);
   if (!UpdateLiveIns)
     MRI.invalidateLiveness();
@@ -352,7 +351,7 @@ void BranchFolder::ReplaceTailWithBranch
 
   if (UpdateLiveIns) {
     NewDest->clearLiveIns();
-    computeLiveIns(LiveRegs, *MRI, *NewDest);
+    computeLiveIns(LiveRegs, *TRI, *NewDest);
   }
 
   ++NumTailMerge;
@@ -389,7 +388,7 @@ MachineBasicBlock *BranchFolder::SplitMB
   MBBFreqInfo.setBlockFreq(NewMBB, MBBFreqInfo.getBlockFreq(&CurMBB));
 
   if (UpdateLiveIns)
-    computeLiveIns(LiveRegs, *MRI, *NewMBB);
+    computeLiveIns(LiveRegs, *TRI, *NewMBB);
 
   // Add the new block to the funclet.
   const auto &FuncletI = FuncletMembership.find(&CurMBB);

Modified: llvm/trunk/lib/CodeGen/BranchFolding.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.h?rev=303955&r1=303954&r2=303955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchFolding.h (original)
+++ llvm/trunk/lib/CodeGen/BranchFolding.h Thu May 25 20:29:32 2017
@@ -108,7 +108,6 @@ namespace llvm {
     bool UpdateLiveIns;
     unsigned MinCommonTailLength;
     const TargetInstrInfo *TII;
-    const MachineRegisterInfo *MRI;
     const TargetRegisterInfo *TRI;
     MachineModuleInfo *MMI;
     MachineLoopInfo *MLI;

Modified: llvm/trunk/lib/CodeGen/BranchRelaxation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchRelaxation.cpp?rev=303955&r1=303954&r2=303955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/BranchRelaxation.cpp (original)
+++ llvm/trunk/lib/CodeGen/BranchRelaxation.cpp Thu May 25 20:29:32 2017
@@ -259,7 +259,7 @@ MachineBasicBlock *BranchRelaxation::spl
 
   // Need to fix live-in lists if we track liveness.
   if (TRI->trackLivenessAfterRegAlloc(*MF))
-    computeLiveIns(LiveRegs, MF->getRegInfo(), *NewBB);
+    computeLiveIns(LiveRegs, *TRI, *NewBB);
 
   ++NumSplit;
 

Modified: llvm/trunk/lib/CodeGen/LivePhysRegs.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/LivePhysRegs.cpp?rev=303955&r1=303954&r2=303955&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/LivePhysRegs.cpp (original)
+++ llvm/trunk/lib/CodeGen/LivePhysRegs.cpp Thu May 25 20:29:32 2017
@@ -214,10 +214,8 @@ void LivePhysRegs::addLiveIns(const Mach
   addBlockLiveIns(MBB);
 }
 
-void llvm::computeLiveIns(LivePhysRegs &LiveRegs,
-                          const MachineRegisterInfo &MRI,
+void llvm::computeLiveIns(LivePhysRegs &LiveRegs, const TargetRegisterInfo &TRI,
                           MachineBasicBlock &MBB) {
-  const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo();
   assert(MBB.livein_empty());
   LiveRegs.init(TRI);
   LiveRegs.addLiveOutsNoPristines(MBB);
@@ -225,12 +223,10 @@ void llvm::computeLiveIns(LivePhysRegs &
     LiveRegs.stepBackward(MI);
 
   for (unsigned Reg : LiveRegs) {
-    if (MRI.isReserved(Reg))
-      continue;
     // Skip the register if we are about to add one of its super registers.
     bool ContainsSuperReg = false;
     for (MCSuperRegIterator SReg(Reg, &TRI); SReg.isValid(); ++SReg) {
-      if (LiveRegs.contains(*SReg) && !MRI.isReserved(*SReg)) {
+      if (LiveRegs.contains(*SReg)) {
         ContainsSuperReg = true;
         break;
       }




More information about the llvm-commits mailing list