[Openmp-commits] [openmp] FIX some OMPT tests that fail on RISC-V (PR #156914)

via Openmp-commits openmp-commits at lists.llvm.org
Fri Feb 13 07:55:51 PST 2026


https://github.com/julianmorillo updated https://github.com/llvm/llvm-project/pull/156914

>From 18cfc9e6f9283a64b369cbf1adc4a38b9a478478 Mon Sep 17 00:00:00 2001
From: Julian Morillo <julian.morillo at bsc.es>
Date: Thu, 4 Sep 2025 17:41:23 +0200
Subject: [PATCH 1/3] Mark as UNSUPPORTED some OMPT tests that fail on RISC-V

---
 openmp/runtime/test/ompt/misc/control_tool.c                | 1 +
 openmp/runtime/test/ompt/synchronization/barrier/explicit.c | 1 +
 openmp/runtime/test/ompt/synchronization/critical.c         | 1 +
 openmp/runtime/test/ompt/synchronization/flush.c            | 1 +
 openmp/runtime/test/ompt/synchronization/ordered.c          | 1 +
 openmp/runtime/test/ompt/synchronization/taskgroup.c        | 1 +
 openmp/runtime/test/ompt/synchronization/taskwait.c         | 1 +
 7 files changed, 7 insertions(+)

diff --git a/openmp/runtime/test/ompt/misc/control_tool.c b/openmp/runtime/test/ompt/misc/control_tool.c
index 4b671e9eeab4d..77029271bd034 100644
--- a/openmp/runtime/test/ompt/misc/control_tool.c
+++ b/openmp/runtime/test/ompt/misc/control_tool.c
@@ -2,6 +2,7 @@
 // RUN: %libomp-compile-and-run | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
+// UNSUPPORTED: riscv64
 // clang-format on
 #define TEST_NEED_PRINT_FRAME_FROM_OUTLINED_FN
 #include "callback.h"
diff --git a/openmp/runtime/test/ompt/synchronization/barrier/explicit.c b/openmp/runtime/test/ompt/synchronization/barrier/explicit.c
index 134f46e6f3340..f3e4730412bef 100644
--- a/openmp/runtime/test/ompt/synchronization/barrier/explicit.c
+++ b/openmp/runtime/test/ompt/synchronization/barrier/explicit.c
@@ -2,6 +2,7 @@
 // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
+// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/critical.c b/openmp/runtime/test/ompt/synchronization/critical.c
index 866f61614a910..a7f319020bc98 100644
--- a/openmp/runtime/test/ompt/synchronization/critical.c
+++ b/openmp/runtime/test/ompt/synchronization/critical.c
@@ -2,6 +2,7 @@
 // RUN: %libomp-compile-and-run | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
+// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/flush.c b/openmp/runtime/test/ompt/synchronization/flush.c
index 78dff0c9cb9c3..fe4f4e0f5758d 100644
--- a/openmp/runtime/test/ompt/synchronization/flush.c
+++ b/openmp/runtime/test/ompt/synchronization/flush.c
@@ -4,6 +4,7 @@
 // GCC generates code that does not call the runtime for the flush construct
 // XFAIL: gcc
 // clang-format on
+// UNSUPPORTED: riscv64
 
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/ordered.c b/openmp/runtime/test/ompt/synchronization/ordered.c
index 38d4ef1269ace..6ff28389bf60f 100644
--- a/openmp/runtime/test/ompt/synchronization/ordered.c
+++ b/openmp/runtime/test/ompt/synchronization/ordered.c
@@ -2,6 +2,7 @@
 // RUN: %libomp-compile-and-run | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
+// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/taskgroup.c b/openmp/runtime/test/ompt/synchronization/taskgroup.c
index 0fcf537120dc2..50918834123d6 100644
--- a/openmp/runtime/test/ompt/synchronization/taskgroup.c
+++ b/openmp/runtime/test/ompt/synchronization/taskgroup.c
@@ -2,6 +2,7 @@
 // RUN:  %libomp-compile-and-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
+// UNSUPPORTED: riscv64
 // clang-format on
 
 #include "callback.h"
diff --git a/openmp/runtime/test/ompt/synchronization/taskwait.c b/openmp/runtime/test/ompt/synchronization/taskwait.c
index 769c1a85e3e9c..cb8edb1edd2f8 100644
--- a/openmp/runtime/test/ompt/synchronization/taskwait.c
+++ b/openmp/runtime/test/ompt/synchronization/taskwait.c
@@ -2,6 +2,7 @@
 // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
+// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>

>From 2b44880feebb363acab3a38c8ee6681619bf5ac6 Mon Sep 17 00:00:00 2001
From: julianmorillo <julian.morillo at bsc.es>
Date: Fri, 13 Feb 2026 16:47:42 +0100
Subject: [PATCH 2/3] [RISC-V] Fix some ompt_tests instead of marking them as
 unsupported

---
 openmp/runtime/test/ompt/callback.h                         | 4 ++--
 openmp/runtime/test/ompt/misc/control_tool.c                | 1 -
 openmp/runtime/test/ompt/synchronization/barrier/explicit.c | 1 -
 openmp/runtime/test/ompt/synchronization/critical.c         | 1 -
 openmp/runtime/test/ompt/synchronization/flush.c            | 1 -
 openmp/runtime/test/ompt/synchronization/ordered.c          | 1 -
 openmp/runtime/test/ompt/synchronization/taskgroup.c        | 1 -
 openmp/runtime/test/ompt/synchronization/taskwait.c         | 1 -
 8 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index cd8acb57ee2f7..e4e5e38b2868d 100644
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -292,8 +292,8 @@ static void print_ids(int level) {
 // another branch).
 #define print_possible_return_addresses(addr)                                  \
   printf("%" PRIu64 ": current_address=%p or %p\n",                            \
-         ompt_get_thread_data()->value, ((char *)addr) - 6,                    \
-         ((char *)addr) - 10)
+         ompt_get_thread_data()->value, ((char *)addr) - 4,                    \
+	 ((char *)addr) - 6, ((char *)addr) - 10)
 #else
 // On RV64G the NOP instruction is 4 byte long. In addition, the compiler
 // inserts a J instruction (targeting the successor basic block), which
diff --git a/openmp/runtime/test/ompt/misc/control_tool.c b/openmp/runtime/test/ompt/misc/control_tool.c
index 77029271bd034..4b671e9eeab4d 100644
--- a/openmp/runtime/test/ompt/misc/control_tool.c
+++ b/openmp/runtime/test/ompt/misc/control_tool.c
@@ -2,7 +2,6 @@
 // RUN: %libomp-compile-and-run | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
-// UNSUPPORTED: riscv64
 // clang-format on
 #define TEST_NEED_PRINT_FRAME_FROM_OUTLINED_FN
 #include "callback.h"
diff --git a/openmp/runtime/test/ompt/synchronization/barrier/explicit.c b/openmp/runtime/test/ompt/synchronization/barrier/explicit.c
index f3e4730412bef..134f46e6f3340 100644
--- a/openmp/runtime/test/ompt/synchronization/barrier/explicit.c
+++ b/openmp/runtime/test/ompt/synchronization/barrier/explicit.c
@@ -2,7 +2,6 @@
 // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
-// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/critical.c b/openmp/runtime/test/ompt/synchronization/critical.c
index a7f319020bc98..866f61614a910 100644
--- a/openmp/runtime/test/ompt/synchronization/critical.c
+++ b/openmp/runtime/test/ompt/synchronization/critical.c
@@ -2,7 +2,6 @@
 // RUN: %libomp-compile-and-run | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
-// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/flush.c b/openmp/runtime/test/ompt/synchronization/flush.c
index fe4f4e0f5758d..78dff0c9cb9c3 100644
--- a/openmp/runtime/test/ompt/synchronization/flush.c
+++ b/openmp/runtime/test/ompt/synchronization/flush.c
@@ -4,7 +4,6 @@
 // GCC generates code that does not call the runtime for the flush construct
 // XFAIL: gcc
 // clang-format on
-// UNSUPPORTED: riscv64
 
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/ordered.c b/openmp/runtime/test/ompt/synchronization/ordered.c
index 6ff28389bf60f..38d4ef1269ace 100644
--- a/openmp/runtime/test/ompt/synchronization/ordered.c
+++ b/openmp/runtime/test/ompt/synchronization/ordered.c
@@ -2,7 +2,6 @@
 // RUN: %libomp-compile-and-run | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
-// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>
diff --git a/openmp/runtime/test/ompt/synchronization/taskgroup.c b/openmp/runtime/test/ompt/synchronization/taskgroup.c
index 50918834123d6..0fcf537120dc2 100644
--- a/openmp/runtime/test/ompt/synchronization/taskgroup.c
+++ b/openmp/runtime/test/ompt/synchronization/taskgroup.c
@@ -2,7 +2,6 @@
 // RUN:  %libomp-compile-and-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
-// UNSUPPORTED: riscv64
 // clang-format on
 
 #include "callback.h"
diff --git a/openmp/runtime/test/ompt/synchronization/taskwait.c b/openmp/runtime/test/ompt/synchronization/taskwait.c
index cb8edb1edd2f8..769c1a85e3e9c 100644
--- a/openmp/runtime/test/ompt/synchronization/taskwait.c
+++ b/openmp/runtime/test/ompt/synchronization/taskwait.c
@@ -2,7 +2,6 @@
 // RUN: %libomp-compile-and-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 // UNSUPPORTED: gcc-4, gcc-5, gcc-6, gcc-7
-// UNSUPPORTED: riscv64
 // clang-format on
 #include "callback.h"
 #include <omp.h>

>From 95e0cf0aaf61f068a67aec79e656aee9042f6cec Mon Sep 17 00:00:00 2001
From: julianmorillo <julian.morillo at bsc.es>
Date: Fri, 13 Feb 2026 16:54:21 +0100
Subject: [PATCH 3/3] Solve formatting issue

---
 openmp/runtime/test/ompt/callback.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openmp/runtime/test/ompt/callback.h b/openmp/runtime/test/ompt/callback.h
index e4e5e38b2868d..2d65ad7065816 100644
--- a/openmp/runtime/test/ompt/callback.h
+++ b/openmp/runtime/test/ompt/callback.h
@@ -293,7 +293,7 @@ static void print_ids(int level) {
 #define print_possible_return_addresses(addr)                                  \
   printf("%" PRIu64 ": current_address=%p or %p\n",                            \
          ompt_get_thread_data()->value, ((char *)addr) - 4,                    \
-	 ((char *)addr) - 6, ((char *)addr) - 10)
+         ((char *)addr) - 6, ((char *)addr) - 10)
 #else
 // On RV64G the NOP instruction is 4 byte long. In addition, the compiler
 // inserts a J instruction (targeting the successor basic block), which



More information about the Openmp-commits mailing list