[Openmp-commits] [PATCH] D128403: [OpenMP] add 4 custom APIs supporting MSVC OMP codegen

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 28 09:00:27 PDT 2022


protze.joachim added inline comments.


================
Comment at: openmp/runtime/src/kmp_csupport.cpp:2279-2293
+#if OMPT_SUPPORT
+  if (ompt_enabled.enabled) {
+    OMPT_STORE_RETURN_ADDRESS(gtid);
+  }
+#endif
+#if USE_ITT_NOTIFY
+  __kmp_threads[gtid]->th.th_ident = loc; // TODO: check if it is needed (e.g.
----------------
This should all go away with removing the second barrier, I think. 


================
Comment at: openmp/runtime/src/kmp_dispatch.cpp:2312-2314
+#if OMPT_SUPPORT && OMPT_OPTIONAL
+  OMPT_STORE_RETURN_ADDRESS(gtid);
+#endif
----------------
The value is only used locally, so rather use OMPT_GET_RETURN_ADDRESS(0) instead of OMPT_LOAD_RETURN_ADDRESS(gtid)) below and remove this block.


================
Comment at: openmp/runtime/src/kmp_dispatch.cpp:2457-2465
+#if OMPT_SUPPORT && OMPT_OPTIONAL
+    if (ompt_enabled.ompt_callback_work) {
+      ompt_team_info_t *team_info = __ompt_get_teaminfo(0, NULL);
+      ompt_task_info_t *task_info = __ompt_get_task_info_object(0);
+      ompt_callbacks.ompt_callback(ompt_callback_work)(
+          ompt_work_sections, ompt_scope_end, &(team_info->parallel_data),
+          &(task_info->task_data), 0, OMPT_LOAD_RETURN_ADDRESS(gtid));
----------------
This should be an ompt_callback_dispatch. The callback for end of sections is already in below function.


================
Comment at: openmp/runtime/src/kmp_dispatch.cpp:2485-2487
+#if OMPT_SUPPORT && OMPT_OPTIONAL
+  OMPT_STORE_RETURN_ADDRESS(gtid);
+#endif
----------------
The value is only used locally, so rather use OMPT_GET_RETURN_ADDRESS(0) instead of OMPT_LOAD_RETURN_ADDRESS(gtid)) below and remove this block.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128403/new/

https://reviews.llvm.org/D128403



More information about the Openmp-commits mailing list