llvm-project
72cc4449 - [TargetFrameLowering] Refactor `determineCalleeSaves`.

Commit
111 days ago
[TargetFrameLowering] Refactor `determineCalleeSaves`. Split up `determineCaleeSaves` into: `const MCPhysReg *getMustPreserveRegisters(MachineFunction &MF) const`: Return the list of registers which must be preserved by the function: the value on exit must be the same as the value on entry. A register from this list does not need to be saved / reloaded if the function did not use it. `virtual void determineUncondPrologCalleeSaves(MachineFunction &MF, const MCPhysReg *CSRegs, BitVector &UncondPrologCSRs) const`: Determines which of the registers reported by getMustPreserveRegisters() must be saved in prolog and reloaded in epilog regardless of wheather or not they were modified by the function. `virtual void determineEarlyCalleeSaves(MachineFunction &MF, BitVector &EarlyCSRs)`: Returns the difference between getMustPreserveRegisters and determineUncondPrologCalleeSaves. These registers will be preserved by the code optimizer and do not need to be saved in prolog. `virtual void determinePrologCalleeSaves(MachineFunction &MF, BitVector &PrologCSRs, RegScavenger *RS) const`: This method returns those registers in the difference of getMustPreserveRegisters and determineEarlyCalleeSaves that were modified by the function and need to be saved in prolog.
Author
Mikhail Gudim
Committer
Parents
Loading