diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2018-08-09 22:04:30 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2018-08-09 22:04:30 +0000 |
commit | baad3f6016b87cbd03578a1df6c6ea69280c4608 (patch) | |
tree | 3e56c3fb3ee58e87ca95e731d4ed4ec9eec793c0 /openmp/runtime/src/kmp_runtime.cpp | |
parent | 7da7b56830d94447e75479cbac71e5813496da38 (diff) | |
download | bcm5719-llvm-baad3f6016b87cbd03578a1df6c6ea69280c4608.tar.gz bcm5719-llvm-baad3f6016b87cbd03578a1df6c6ea69280c4608.zip |
[OpenMP] Cleanup code
This patch cleans up unused functions, variables, sign compare issues, and
addresses some -Warning flags which are now enabled including -Wcast-qual.
Not all the warning flags in LibompHandleFlags.cmake are enabled, but some
are with this patch.
Some __kmp_gtid_from_* macros in kmp.h are switched to static inline functions
which allows us to remove the awkward definition of KMP_DEBUG_ASSERT() and
KMP_ASSERT() macros which used the comma operator. This had to be done for the
innumerable -Wunused-value warnings related to KMP_DEBUG_ASSERT()
Differential Revision: https://reviews.llvm.org/D49105
llvm-svn: 339393
Diffstat (limited to 'openmp/runtime/src/kmp_runtime.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_runtime.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/openmp/runtime/src/kmp_runtime.cpp b/openmp/runtime/src/kmp_runtime.cpp index bf0f9dc03e3..0ccf6a5e8e7 100644 --- a/openmp/runtime/src/kmp_runtime.cpp +++ b/openmp/runtime/src/kmp_runtime.cpp @@ -4007,10 +4007,11 @@ void __kmp_task_info() { kmp_team_t *steam = this_thr->th.th_serial_team; kmp_team_t *team = this_thr->th.th_team; - __kmp_printf("__kmp_task_info: gtid=%d tid=%d t_thread=%p team=%p curtask=%p " - "ptask=%p\n", - gtid, tid, this_thr, team, this_thr->th.th_current_task, - team->t.t_implicit_task_taskdata[tid].td_parent); + __kmp_printf( + "__kmp_task_info: gtid=%d tid=%d t_thread=%p team=%p steam=%p curtask=%p " + "ptask=%p\n", + gtid, tid, this_thr, team, steam, this_thr->th.th_current_task, + team->t.t_implicit_task_taskdata[tid].td_parent); } #endif // KMP_DEBUG @@ -6293,7 +6294,7 @@ void __kmp_register_library_startup(void) { if (tail != NULL) { long *flag_addr = 0; long flag_val = 0; - KMP_SSCANF(flag_addr_str, "%p", &flag_addr); + KMP_SSCANF(flag_addr_str, "%p", RCAST(void**, &flag_addr)); KMP_SSCANF(flag_val_str, "%lx", &flag_val); if (flag_addr != 0 && flag_val != 0 && strcmp(file_name, "") != 0) { // First, check whether environment-encoded address is mapped into @@ -7638,7 +7639,6 @@ __kmp_determine_reduction_method( } else { int atomic_available = FAST_REDUCTION_ATOMIC_METHOD_GENERATED; - int tree_available = FAST_REDUCTION_TREE_METHOD_GENERATED; #if KMP_ARCH_X86_64 || KMP_ARCH_PPC64 || KMP_ARCH_AARCH64 || KMP_ARCH_MIPS64 @@ -7652,6 +7652,7 @@ __kmp_determine_reduction_method( teamsize_cutoff = 8; } #endif + int tree_available = FAST_REDUCTION_TREE_METHOD_GENERATED; if (tree_available) { if (team_size <= teamsize_cutoff) { if (atomic_available) { @@ -7682,6 +7683,7 @@ __kmp_determine_reduction_method( #elif KMP_OS_DARWIN + int tree_available = FAST_REDUCTION_TREE_METHOD_GENERATED; if (atomic_available && (num_vars <= 3)) { retval = atomic_reduce_block; } else if (tree_available) { |