Skip to content

Commit 3b550b9

Browse files
Fix comments about stack bump
We actually do already have code to split the stack bump... but only when optimizing for size.
1 parent 79ba522 commit 3b550b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

llvm/lib/Target/AArch64/AArch64PrologueEpilogue.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,7 @@ AArch64PrologueEpilogueCommon::convertCalleeSaveRestoreToSPPrePostIncDec(
183183
// update in so create a normal arithmetic instruction instead.
184184
//
185185
// On Windows, some register pairs involving LR can't be folded because
186-
// there isn't a corresponding unwind opcode. (Note that packed unwind expects
187-
// a sequence like "sub sp, sp, #16; stp x19, lr, [sp]; sub sp, sp, #16",
188-
// but we currently generate "sub sp, sp, #32; stp x19, lr, [sp, #16]". We
189-
// could handle that here, but it's not clearly profitable; it saves up to
190-
// 4 words of xdata, but it costs 2 instructions.)
186+
// there isn't a corresponding unwind opcode.
191187
if (MBBI->getOperand(MBBI->getNumOperands() - 1).getImm() != 0 ||
192188
CSStackSizeInc < MinOffset * (int64_t)Scale.getFixedValue() ||
193189
CSStackSizeInc > MaxOffset * (int64_t)Scale.getFixedValue() ||
@@ -334,6 +330,10 @@ bool AArch64PrologueEpilogueCommon::shouldCombineCSRLocalStackBump(
334330
// (to force a stp with predecrement) to match the packed unwind format,
335331
// provided that there actually are any callee saved registers to merge the
336332
// decrement with.
333+
//
334+
// Note that for certain paired saves, like "x19, lr", we can't actually
335+
// combine the save, but packed unwind still expects a separate stack bump.
336+
//
337337
// This is potentially marginally slower, but allows using the packed
338338
// unwind format for functions that both have a local area and callee saved
339339
// registers. Using the packed unwind format notably reduces the size of

0 commit comments

Comments
 (0)