[PATCH] D156986: [PEI] Remove support for register scavenging during forwards frame index elimination

Jay Foad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 3 03:53:54 PDT 2023


foad created this revision.
foad added reviewers: arsenm, fhahn, qcolombet, MatzeB, bogner.
Herald added subscribers: StephenFan, arphaman, hiraditya.
Herald added a project: All.
foad requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

All targets that require register scavenging now use backwards frame
index elimination.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156986

Files:
  llvm/lib/CodeGen/PrologEpilogInserter.cpp


Index: llvm/lib/CodeGen/PrologEpilogInserter.cpp
===================================================================
--- llvm/lib/CodeGen/PrologEpilogInserter.cpp
+++ 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;
   }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156986.546793.patch
Type: text/x-patch
Size: 1335 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230803/23ac3918/attachment.bin>


More information about the llvm-commits mailing list