diff options
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/BranchFolding.cpp | 2 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/PrologEpilogInserter.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/RegisterScavenging.cpp | 11 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/TailDuplication.cpp | 2 |
4 files changed, 8 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp index 0a6e88ea45b..065bac015c5 100644 --- a/llvm/lib/CodeGen/BranchFolding.cpp +++ b/llvm/lib/CodeGen/BranchFolding.cpp @@ -397,7 +397,7 @@ static unsigned ComputeCommonTailLength(MachineBasicBlock *MBB1, void BranchFolder::MaintainLiveIns(MachineBasicBlock *CurMBB, MachineBasicBlock *NewMBB) { if (RS) { - RS->enterBasicBlock(CurMBB); + RS->enterBasicBlock(*CurMBB); if (!CurMBB->empty()) RS->forward(std::prev(CurMBB->end())); for (unsigned int i = 1, e = TRI->getNumRegs(); i != e; i++) diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index 84b202128e4..7c3fe33cf75 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -880,7 +880,7 @@ void PEI::replaceFrameIndices(MachineBasicBlock *BB, MachineFunction &Fn, unsigned FrameSetupOpcode = TII.getCallFrameSetupOpcode(); unsigned FrameDestroyOpcode = TII.getCallFrameDestroyOpcode(); - if (RS && !FrameIndexVirtualScavenging) RS->enterBasicBlock(BB); + if (RS && !FrameIndexVirtualScavenging) RS->enterBasicBlock(*BB); bool InsideCallSequence = false; @@ -991,7 +991,7 @@ PEI::scavengeFrameVirtualRegs(MachineFunction &Fn) { // Run through the instructions and find any virtual registers. for (MachineFunction::iterator BB = Fn.begin(), E = Fn.end(); BB != E; ++BB) { - RS->enterBasicBlock(&*BB); + RS->enterBasicBlock(*BB); int SPAdj = 0; diff --git a/llvm/lib/CodeGen/RegisterScavenging.cpp b/llvm/lib/CodeGen/RegisterScavenging.cpp index 8fa1bf74b7e..8e002749d3b 100644 --- a/llvm/lib/CodeGen/RegisterScavenging.cpp +++ b/llvm/lib/CodeGen/RegisterScavenging.cpp @@ -49,9 +49,6 @@ void RegScavenger::initRegState() { // All register units start out unused. RegUnitsAvailable.set(); - if (!MBB) - return; - // Live-in registers are in use. for (const auto &LI : MBB->liveins()) setRegUsed(LI.PhysReg, LI.LaneMask); @@ -63,8 +60,8 @@ void RegScavenger::initRegState() { setRegUsed(I); } -void RegScavenger::enterBasicBlock(MachineBasicBlock *mbb) { - MachineFunction &MF = *mbb->getParent(); +void RegScavenger::enterBasicBlock(MachineBasicBlock &MBB) { + MachineFunction &MF = *MBB.getParent(); TII = MF.getSubtarget().getInstrInfo(); TRI = MF.getSubtarget().getRegisterInfo(); MRI = &MF.getRegInfo(); @@ -78,15 +75,15 @@ void RegScavenger::enterBasicBlock(MachineBasicBlock *mbb) { "Cannot use register scavenger with inaccurate liveness"); // Self-initialize. - if (!MBB) { + if (!this->MBB) { NumRegUnits = TRI->getNumRegUnits(); RegUnitsAvailable.resize(NumRegUnits); KillRegUnits.resize(NumRegUnits); DefRegUnits.resize(NumRegUnits); TmpRegUnits.resize(NumRegUnits); } + this->MBB = &MBB; - MBB = mbb; initRegState(); Tracking = false; diff --git a/llvm/lib/CodeGen/TailDuplication.cpp b/llvm/lib/CodeGen/TailDuplication.cpp index 2a8431c2bab..7dca17ccd9a 100644 --- a/llvm/lib/CodeGen/TailDuplication.cpp +++ b/llvm/lib/CodeGen/TailDuplication.cpp @@ -816,7 +816,7 @@ TailDuplicatePass::TailDuplicate(MachineBasicBlock *TailBB, if (RS && !TailBB->livein_empty()) { // Update PredBB livein. - RS->enterBasicBlock(PredBB); + RS->enterBasicBlock(*PredBB); if (!PredBB->empty()) RS->forward(std::prev(PredBB->end())); for (const auto &LI : TailBB->liveins()) { |

