diff --git a/llvm/docs/ReleaseNotes.rst b/llvm/docs/ReleaseNotes.rst --- a/llvm/docs/ReleaseNotes.rst +++ b/llvm/docs/ReleaseNotes.rst @@ -123,6 +123,10 @@ Changes to the CodeGen infrastructure ------------------------------------- +* ``PrologEpilogInserter`` no longer supports register scavenging + during forwards frame index elimination. Targets should use + backwards frame index elimination instead. + Changes to the Metadata Info --------------------------------- diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -1531,9 +1531,6 @@ const TargetRegisterInfo &TRI = *MF.getSubtarget().getRegisterInfo(); const TargetFrameLowering *TFI = MF.getSubtarget().getFrameLowering(); - if (RS && FrameIndexEliminationScavenging) - RS->enterBasicBlock(*BB); - bool InsideCallSequence = false; for (MachineBasicBlock::iterator I = BB->begin(); I != BB->end(); ) { @@ -1567,8 +1564,7 @@ // If this instruction has a FrameIndex operand, we need to // use that target machine register info object to eliminate // it. - TRI.eliminateFrameIndex(MI, SPAdj, i, - FrameIndexEliminationScavenging ? RS : nullptr); + TRI.eliminateFrameIndex(MI, SPAdj, i); // Reset the iterator if we were at the beginning of the BB. if (AtBeginning) { @@ -1590,10 +1586,7 @@ if (DidFinishLoop && InsideCallSequence) SPAdj += TII.getSPAdjust(MI); - if (DoIncr && I != BB->end()) ++I; - - // Update register states. - if (RS && FrameIndexEliminationScavenging && DidFinishLoop) - RS->forward(MI); + if (DoIncr && I != BB->end()) + ++I; } }