From 6491bdfb02917957a99b783d579497efadac45ee Mon Sep 17 00:00:00 2001 From: zhoujing Date: Sun, 27 Aug 2023 15:47:26 +0800 Subject: [PATCH] Revert "[VENTUS][fix] No need to spill/restore callee saved registers for kernel function" This reverts commit 85df9000bb30a0374d60b62e56960a2dbe7093ce. --- llvm/lib/Target/RISCV/RISCVFrameLowering.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp index ec780329d01b..b80c3d08e3e4 100644 --- a/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp +++ b/llvm/lib/Target/RISCV/RISCVFrameLowering.cpp @@ -735,9 +735,6 @@ bool RISCVFrameLowering::spillCalleeSavedRegisters( return true; MachineFunction *MF = MBB.getParent(); - // For kernel function, no need to spill callee saved register - if(MF->getInfo()->isEntryFunction()) - return true; const TargetInstrInfo &TII = *MF->getSubtarget().getInstrInfo(); DebugLoc DL; if (MI != MBB.end() && !MI->isDebugInstr()) @@ -785,9 +782,6 @@ bool RISCVFrameLowering::restoreCalleeSavedRegisters( return true; MachineFunction *MF = MBB.getParent(); - // If kernel function, no need to restore CalleeSavedRegisters - if(MF->getInfo()->isEntryFunction()) - return true; const TargetInstrInfo &TII = *MF->getSubtarget().getInstrInfo(); DebugLoc DL; if (MI != MBB.end() && !MI->isDebugInstr())