[Openmp-commits] [openmp] [NFC] fix failed ompt tests on M1 device (PR #65696)

Lixi Zhou via Openmp-commits openmp-commits at lists.llvm.org
Thu Sep 7 19:56:59 PDT 2023


https://github.com/lixi-zhou updated https://github.com/llvm/llvm-project/pull/65696:

>From eacec22651766c6c6961d14964ddb6a180fbfec0 Mon Sep 17 00:00:00 2001
From: Lixi Zhou <zhoulx2013 at gmail.com>
Date: Thu, 7 Sep 2023 16:15:25 -0700
Subject: [PATCH 1/2] fix failed ompt test on M1 device

---
 openmp/runtime/test/ompt/callback.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index 8180b3d2663f769..d8218113d4b197b 100644
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -190,8 +190,8 @@ ompt_label_##id:
 // On AArch64 the NOP instruction is 4 bytes long, can be followed by inserted
 // store instruction (another 4 bytes long).
 #define print_possible_return_addresses(addr) \
-  printf("%" PRIu64 ": current_address=%p or %p\n", ompt_get_thread_data()->value, \
-         ((char *)addr) - 4, ((char *)addr) - 8)
+  printf("%" PRIu64 ": current_address=%p or %p or %p\n", ompt_get_thread_data()->value, \
+         ((char *)addr) - 4, ((char *)addr) - 8, ((char *)addr) - 12)
 #elif KMP_ARCH_RISCV64
 #if __riscv_compressed
 // On RV64GC the C.NOP instruction is 2 byte long. In addition, the compiler

>From c671472094bef439d0eac3588261557d5c496cdc Mon Sep 17 00:00:00 2001
From: Lixi Zhou <zhoulx2013 at gmail.com>
Date: Thu, 7 Sep 2023 19:56:46 -0700
Subject: [PATCH 2/2] update code

---
 openmp/runtime/test/ompt/callback.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index d8218113d4b197b..ffaa25af45b557c 100644
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -190,8 +190,12 @@ ompt_label_##id:
 // On AArch64 the NOP instruction is 4 bytes long, can be followed by inserted
 // store instruction (another 4 bytes long).
 #define print_possible_return_addresses(addr) \
-  printf("%" PRIu64 ": current_address=%p or %p or %p\n", ompt_get_thread_data()->value, \
-         ((char *)addr) - 4, ((char *)addr) - 8, ((char *)addr) - 12)
+  if KMP_OS_DARWIN:
+    printf("%" PRIu64 ": current_address=%p or %p or %p\n", ompt_get_thread_data()->value, \
+            ((char *)addr) - 4, ((char *)addr) - 8, ((char *)addr) - 12)
+  else:
+    printf("%" PRIu64 ": current_address=%p or %p\n", ompt_get_thread_data()->value, \
+         ((char *)addr) - 4, ((char *)addr) - 8)
 #elif KMP_ARCH_RISCV64
 #if __riscv_compressed
 // On RV64GC the C.NOP instruction is 2 byte long. In addition, the compiler



More information about the Openmp-commits mailing list