[llvm] [llvm] Support multiple save/restore points in mir (PR #119357)
Elizaveta Noskova via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 11 08:15:11 PDT 2025
================
@@ -423,16 +423,20 @@ void PEIImpl::calculateCallFrameInfo(MachineFunction &MF) {
/// callee-saved registers, and placing prolog and epilog code.
void PEIImpl::calculateSaveRestoreBlocks(MachineFunction &MF) {
const MachineFrameInfo &MFI = MF.getFrameInfo();
-
// Even when we do not change any CSR, we still want to insert the
// prologue and epilogue of the function.
// So set the save points for those.
// Use the points found by shrink-wrapping, if any.
- if (MFI.getSavePoint()) {
- SaveBlocks.push_back(MFI.getSavePoint());
- assert(MFI.getRestorePoint() && "Both restore and save must be set");
- MachineBasicBlock *RestoreBlock = MFI.getRestorePoint();
+ if (!MFI.getSavePoints().empty()) {
+ assert(MFI.getSavePoints().size() < 2 &&
+ "MFI can't contain multiple save points!");
----------------
enoskova-sc wrote:
addressed
https://github.com/llvm/llvm-project/pull/119357
More information about the llvm-commits
mailing list