[Openmp-commits] [openmp] [OpenMP][AArch64] Fix frame pointer save in microtask (PR #165313)

Dominik Wójt via Openmp-commits openmp-commits at lists.llvm.org
Mon Oct 27 13:39:55 PDT 2025


https://github.com/dominik-wojt-2311446 created https://github.com/llvm/llvm-project/pull/165313

When OMPT is enabled, the stack pointer was not saved to frame pointer register immediately after storing the frame pointer to the stack. Therefore the frame pointers did not constitute a proper chain.
Fixes [#163352](https://github.com/llvm/llvm-project/issues/163352)

>From e94ab14ab033659c20448bbc7a14e03d6fc28112 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dominik=20W=C3=B3jt?= <dominik.wojt at cognizant.com>
Date: Mon, 13 Oct 2025 10:38:42 +0000
Subject: [PATCH] [OpenMP][AArch64] Fix frame pointer save in microtask

When OMPT is enabled, the stack pointer was not saved to frame pointer
register immediately after storing the frame pointer to the stack.
Therefore the frame pointers did not constitute a proper chain.
---
 openmp/runtime/src/z_Linux_asm.S | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openmp/runtime/src/z_Linux_asm.S b/openmp/runtime/src/z_Linux_asm.S
index 89359759fcb42..6a0f7295d940f 100644
--- a/openmp/runtime/src/z_Linux_asm.S
+++ b/openmp/runtime/src/z_Linux_asm.S
@@ -1360,10 +1360,10 @@ __tid = 8
 	PROC __kmp_invoke_microtask
 	PACBTI_C
 
-	stp	x29, x30, [sp, #-16]!
 # if OMPT_SUPPORT
 	stp	x19, x20, [sp, #-16]!
 # endif
+	stp	x29, x30, [sp, #-16]!
 	mov	x29, sp
 
 	orr	w9, wzr, #1
@@ -1417,11 +1417,11 @@ KMP_LABEL(kmp_1):
 	blr	x8
 	orr	w0, wzr, #1
 	mov	sp, x29
+	ldp	x29, x30, [sp], #16
 # if OMPT_SUPPORT
 	str	xzr, [x19]
 	ldp	x19, x20, [sp], #16
 # endif
-	ldp	x29, x30, [sp], #16
 	PACBTI_RET
 	ret
 



More information about the Openmp-commits mailing list