[llvm] [aarch64] Mix the frame pointer with the stack cookie when protecting the stack (PR #197346)

Pan Tao via llvm-commits llvm-commits at lists.llvm.org
Mon May 18 00:50:38 PDT 2026


================
@@ -31,14 +31,18 @@ declare void @_Z7CapturePi(ptr)
 
 ; WINDOWS-AARCH64: adrp x8, __security_cookie
 ; WINDOWS-AARCH64: ldr x8, [x8, :lo12:__security_cookie]
+; WINDOWS-AARCH64: sub x8, sp, x8
 ; WINDOWS-AARCH64: str x8, [sp, #8]
 ; WINDOWS-AARCH64: bl  _Z7CapturePi
-; WINDOWS-AARCH64: ldr x0, [sp, #8]
+; WINDOWS-AARCH64: ldr x9, [sp, #8]
+; WINDOWS-AARCH64: sub x8, sp, x8
----------------
PanTao2 wrote:

Thank you for pointing out the confusing check items.
These two lines belong to %bb.0, before the cmp instruction.  I have changed these two lines to check all instructions before '__securace_check_comkie' in failure BB. Could you please help check if the new check items meet your expectations?
I cannot reproduce https://lab.llvm.org/buildbot/#/builders/161/builds/9433 on my arm64 Windows device. @luporl Do you know any way to run the relevant LLVM buildbot before merging this PR? Thank you in advance.
I think the 3 failing checks are unrelated to my changes.

https://github.com/llvm/llvm-project/pull/197346


More information about the llvm-commits mailing list