[Openmp-commits] [llvm] [openmp] [OMPT][Offload][OpenMP] Fixes for OMPT data used by libomptarget (reapply #156020) (PR #175165)

Kaloyan Ignatov via Openmp-commits openmp-commits at lists.llvm.org
Mon Feb 2 06:51:32 PST 2026


================
@@ -236,7 +236,7 @@ class Interface {
   ompt_task_info_t OmptTaskInfo{ompt_data_none, ompt_data_none};
 
   /// Ptr to TaskInfo in OpenMP runtime in case of deferred target tasks
-  ompt_task_info_t *OmptTaskInfoPtr{&OmptTaskInfo};
+  ompt_task_info_t *OmptTaskInfoPtr{nullptr};
----------------
kaloyan-ignatov wrote:

I'm sorry for the late reply. The global constructor already existed due to how the RegionInterface variable is defined in [offload/libomptarget/OpenMP/OMPT/Callback.cpp](https://github.com/RWTH-HPC/llvm-project/blob/offload-ompt-data-fixes/offload/libomptarget/OpenMP/OMPT/Callback.cpp). A global thread-local variable needs a global constructor which the compiler always generated until the latest changes, but when we tried to initialize `OmptTaskInfoPtr` to the address of `OmptTaskInfo`, the compiler complained, as this is non-trivial initialization.

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


More information about the Openmp-commits mailing list