[PATCH] D135687: [AArch64] Fix aligning the stack after calling __chkstk

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 11 14:36:47 PDT 2022


efriedma added a comment.

I was thinking you could do something like this:

  mov x15, #(NumBytes/16) ; Stack allocation size
  mov x9, sp
  and x9, x9, #AlignMask ; compute aligned stack
  sub x9, sp, x9 ; compute number of bytes required to align stack
  add x15, x15, x9, lsr #4 ; add bytes to chkstk input
  bl __chkstk
  sub sp, sp, x15, lsl #4

There's probably some slightly more efficient way to write this, but that's the idea.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135687/new/

https://reviews.llvm.org/D135687



More information about the llvm-commits mailing list