36 lines
1.3 KiB
Plaintext
36 lines
1.3 KiB
Plaintext
$OpenBSD: patch-lib_Target_Mips_MipsFrameLowering_cpp,v 1.2 2020/08/05 06:49:48 jca Exp $
|
|
|
|
Add retguard for octeon/mips64.
|
|
|
|
Index: lib/Target/Mips/MipsFrameLowering.cpp
|
|
--- lib/Target/Mips/MipsFrameLowering.cpp.orig
|
|
+++ lib/Target/Mips/MipsFrameLowering.cpp
|
|
@@ -14,6 +14,7 @@
|
|
#include "MCTargetDesc/MipsBaseInfo.h"
|
|
#include "MipsInstrInfo.h"
|
|
#include "MipsMachineFunction.h"
|
|
+#include "MipsReturnProtectorLowering.h"
|
|
#include "MipsTargetMachine.h"
|
|
#include "llvm/CodeGen/MachineFrameInfo.h"
|
|
#include "llvm/CodeGen/MachineFunction.h"
|
|
@@ -122,6 +123,10 @@ uint64_t MipsFrameLowering::estimateStackSize(const Ma
|
|
if (MFI.getObjectOffset(I) > 0)
|
|
Size += MFI.getObjectSize(I);
|
|
|
|
+ // Account for saving return protector register
|
|
+ if (MFI.getReturnProtectorNeeded())
|
|
+ Size += TRI.getSpillSize(*TRI.getMinimalPhysRegClass(Mips::T9_64));
|
|
+
|
|
// Conservatively assume all callee-saved registers will be saved.
|
|
for (const MCPhysReg *R = TRI.getCalleeSavedRegs(&MF); *R; ++R) {
|
|
unsigned RegSize = TRI.getSpillSize(*TRI.getMinimalPhysRegClass(*R));
|
|
@@ -148,4 +153,8 @@ eliminateCallFramePseudoInstr(MachineFunction &MF, Mac
|
|
}
|
|
|
|
return MBB.erase(I);
|
|
+}
|
|
+
|
|
+const ReturnProtectorLowering *MipsFrameLowering::getReturnProtector() const {
|
|
+ return &RPL;
|
|
}
|