Skip to content

Commit 93785ff

Browse files
authored
[BOLT][AArch64][instr] Remove red zone clobbering protection (#156129)
We can safely remove the red zone clobbering protection in arm64 instrumentation sequence, since there is no red zone in AArch64 ELF/Linux system.
1 parent 1ce90bc commit 93785ff

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2517,10 +2517,8 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25172517
createInstrIncMemory(const MCSymbol *Target, MCContext *Ctx, bool IsLeaf,
25182518
unsigned CodePointerSize) const override {
25192519
unsigned int I = 0;
2520-
InstructionListType Instrs(IsLeaf ? 12 : 10);
2520+
InstructionListType Instrs(10);
25212521

2522-
if (IsLeaf)
2523-
createStackPointerIncrement(Instrs[I++], 128);
25242522
createPushRegisters(Instrs[I++], AArch64::X0, AArch64::X1);
25252523
getSystemFlag(Instrs[I++], AArch64::X1);
25262524
InstructionListType Addr = materializeAddress(Target, Ctx, AArch64::X0);
@@ -2535,8 +2533,6 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
25352533
loadReg(Instrs[I++], AArch64::X2, AArch64::SP);
25362534
setSystemFlag(Instrs[I++], AArch64::X1);
25372535
createPopRegisters(Instrs[I++], AArch64::X0, AArch64::X1);
2538-
if (IsLeaf)
2539-
createStackPointerDecrement(Instrs[I++], 128);
25402536
return Instrs;
25412537
}
25422538

0 commit comments

Comments
 (0)