[llvm] r317309 - [PEI] Simplify handling of targets with no phys regs. NFC
Francis Visoiu Mistrih via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 3 02:46:36 PDT 2017
Author: thegameg
Date: Fri Nov 3 02:46:36 2017
New Revision: 317309
URL: http://llvm.org/viewvc/llvm-project?rev=317309&view=rev
Log:
[PEI] Simplify handling of targets with no phys regs. NFC
Make doSpillCalleeSavedRegs a member function, instead of passing most of the
members of PEI as arguments.
Differential Review: https://reviews.llvm.org/D35642
Modified:
llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
Modified: llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp?rev=317309&r1=317308&r2=317309&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp (original)
+++ llvm/trunk/lib/CodeGen/PrologEpilogInserter.cpp Fri Nov 3 02:46:36 2017
@@ -76,12 +76,6 @@ using namespace llvm;
using MBBVector = SmallVector<MachineBasicBlock *, 4>;
-static void spillCalleeSavedRegs(MachineFunction &MF, RegScavenger *RS,
- unsigned &MinCSFrameIndex,
- unsigned &MaxCXFrameIndex,
- const MBBVector &SaveBlocks,
- const MBBVector &RestoreBlocks);
-
namespace {
class PEI : public MachineFunctionPass {
@@ -125,6 +119,7 @@ private:
void calculateCallFrameInfo(MachineFunction &Fn);
void calculateSaveRestoreBlocks(MachineFunction &Fn);
+ void spillCalleeSavedRegs(MachineFunction &MF);
void calculateFrameObjectOffsets(MachineFunction &Fn);
void replaceFrameIndices(MachineFunction &Fn);
@@ -197,8 +192,7 @@ bool PEI::runOnMachineFunction(MachineFu
// Handle CSR spilling and restoring, for targets that need it.
if (Fn.getTarget().usesPhysRegsForPEI())
- spillCalleeSavedRegs(Fn, RS, MinCSFrameIndex, MaxCSFrameIndex, SaveBlocks,
- RestoreBlocks);
+ spillCalleeSavedRegs(Fn);
// Allow the target machine to make final modifications to the function
// before the frame layout is finalized.
@@ -505,11 +499,7 @@ static void insertCSRRestores(MachineBas
}
}
-static void spillCalleeSavedRegs(MachineFunction &Fn, RegScavenger *RS,
- unsigned &MinCSFrameIndex,
- unsigned &MaxCSFrameIndex,
- const MBBVector &SaveBlocks,
- const MBBVector &RestoreBlocks) {
+void PEI::spillCalleeSavedRegs(MachineFunction &Fn) {
// We can't list this requirement in getRequiredProperties because some
// targets (WebAssembly) use virtual registers past this point, and the pass
// pipeline is set up without giving the passes a chance to look at the
More information about the llvm-commits
mailing list