summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src
diff options
context:
space:
mode:
authorJoachim Protze <protze@itc.rwth-aachen.de>2017-12-21 13:55:39 +0000
committerJoachim Protze <protze@itc.rwth-aachen.de>2017-12-21 13:55:39 +0000
commitf8d22f9db8b5ce50e8deec8e94c7547a4a6b9cbc (patch)
treee42ce23dbf38feb66820cf9dc7cd15aa89969543 /openmp/runtime/src
parent4fe83593ebc4d3759e2119d6f6b20cfa6bde1910 (diff)
downloadbcm5719-llvm-f8d22f9db8b5ce50e8deec8e94c7547a4a6b9cbc.tar.gz
bcm5719-llvm-f8d22f9db8b5ce50e8deec8e94c7547a4a6b9cbc.zip
[OMPT] Fix return address handling in a few GOMP interface methods
This revision fixes failing testcases with parallel for loops and the gomp interface. The return address needs to be stored at entry to runtime. The storage is cleared on usage, so we need to update the storage before calling again internal functions, that will trigger event callbacks. Differential Revision: https://reviews.llvm.org/D41181 llvm-svn: 321265
Diffstat (limited to 'openmp/runtime/src')
-rw-r--r--openmp/runtime/src/kmp_gsupport.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/openmp/runtime/src/kmp_gsupport.cpp b/openmp/runtime/src/kmp_gsupport.cpp
index 83b19734e05..9fa05e6afbe 100644
--- a/openmp/runtime/src/kmp_gsupport.cpp
+++ b/openmp/runtime/src/kmp_gsupport.cpp
@@ -326,10 +326,6 @@ static
long chunk_size) {
// Intialize the loop worksharing construct.
-#if OMPT_SUPPORT
- if (ompt_enabled.enabled)
- OMPT_STORE_RETURN_ADDRESS(*gtid);
-#endif
KMP_DISPATCH_INIT(loc, *gtid, schedule, start, end, incr, chunk_size,
schedule != kmp_sch_static);
@@ -819,8 +815,10 @@ LOOP_NEXT_ULL(KMP_EXPAND_NAME(KMP_API_NAME_GOMP_LOOP_ULL_ORDERED_RUNTIME_NEXT),
(microtask_t)__kmp_GOMP_parallel_microtask_wrapper, \
9, task, data, num_threads, &loc, (schedule), lb, \
(str > 0) ? (ub - 1) : (ub + 1), str, chunk_sz); \
+ IF_OMPT_SUPPORT(OMPT_STORE_RETURN_ADDRESS(gtid)); \
} else { \
__kmp_GOMP_serialized_parallel(&loc, gtid, task); \
+ IF_OMPT_SUPPORT(OMPT_STORE_RETURN_ADDRESS(gtid)); \
} \
\
KMP_DISPATCH_INIT(&loc, gtid, (schedule), lb, \
@@ -1040,6 +1038,10 @@ unsigned KMP_EXPAND_NAME(KMP_API_NAME_GOMP_SECTIONS_NEXT)(void) {
MKLOC(loc, "GOMP_sections_next");
KA_TRACE(20, ("GOMP_sections_next: T#%d\n", gtid));
+#if OMPT_SUPPORT
+ OMPT_STORE_RETURN_ADDRESS(gtid);
+#endif
+
status = KMP_DISPATCH_NEXT(&loc, gtid, NULL, &lb, &ub, &stride);
if (status) {
KMP_DEBUG_ASSERT(stride == 1);
@@ -1206,6 +1208,10 @@ void KMP_EXPAND_NAME(KMP_API_NAME_GOMP_PARALLEL_SECTIONS)(void (*task)(void *),
__kmp_GOMP_serialized_parallel(&loc, gtid, task);
}
+#if OMPT_SUPPORT
+ OMPT_STORE_RETURN_ADDRESS(gtid);
+#endif
+
KMP_DISPATCH_INIT(&loc, gtid, kmp_nm_dynamic_chunked, 1, count, 1, 1, TRUE);
task(data);
OpenPOWER on IntegriCloud