[llvm] [CodeGen] Refactor `determineCalleeSaves`. (PR #166763)
Mikhail Gudim via llvm-commits
llvm-commits at lists.llvm.org
Wed Dec 10 11:55:11 PST 2025
================
@@ -390,9 +390,38 @@ class LLVM_ABI TargetFrameLowering {
/// This method should not be called by any passes outside of PEI, because
/// it may change state passed in by \p MF and \p RS. The preferred
/// interface outside PEI is getCalleeSaves.
+ // LLVM_DEPRECATED("Use determinePrologCalleeSaves instead",
+ // "determinePrologCalleeSaves")
virtual void determineCalleeSaves(MachineFunction &MF, BitVector &SavedRegs,
RegScavenger *RS = nullptr) 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.
+ const MCPhysReg *getMustPreserveRegisters(const MachineFunction &MF) const;
----------------
mgudim wrote:
This function returns the result of `getCalleeSavedRegs()` or `getIPRACSRegs(&MF)` both return just a pointer. It will be hard to change `getCalleeSavedRegs` because every target implements it. I could of course just copy the result into a vector and return it, but do we want that?
https://github.com/llvm/llvm-project/pull/166763
More information about the llvm-commits
mailing list