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_dispatch.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_dispatch.cpp')
| -rw-r--r-- | openmp/runtime/src/kmp_dispatch.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp index 5545ff52031..8e471ab5b42 100644 --- a/openmp/runtime/src/kmp_dispatch.cpp +++ b/openmp/runtime/src/kmp_dispatch.cpp @@ -97,7 +97,6 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid, typename traits_t<T>::signed_t chunk, T nproc, T tid) { typedef typename traits_t<T>::unsigned_t UT; - typedef typename traits_t<T>::signed_t ST; typedef typename traits_t<T>::floating_t DBL; int active; @@ -106,6 +105,7 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid, kmp_team_t *team; #ifdef KMP_DEBUG + typedef typename traits_t<T>::signed_t ST; { char *buff; // create format specifiers before the debug output @@ -731,8 +731,6 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb, T ub, typename traits_t<T>::signed_t st, typename traits_t<T>::signed_t chunk, int push_ws) { typedef typename traits_t<T>::unsigned_t UT; - typedef typename traits_t<T>::signed_t ST; - typedef typename traits_t<T>::floating_t DBL; int active; kmp_info_t *th; @@ -753,6 +751,7 @@ __kmp_dispatch_init(ident_t *loc, int gtid, enum sched_type schedule, T lb, SSC_MARK_DISPATCH_INIT(); #endif #ifdef KMP_DEBUG + typedef typename traits_t<T>::signed_t ST; { char *buff; // create format specifiers before the debug output @@ -1867,7 +1866,6 @@ static int __kmp_dispatch_next(ident_t *loc, int gtid, kmp_int32 *p_last, typedef typename traits_t<T>::unsigned_t UT; typedef typename traits_t<T>::signed_t ST; - typedef typename traits_t<T>::floating_t DBL; // This is potentially slightly misleading, schedule(runtime) will appear here // even if the actual runtme schedule is static. (Which points out a // disadavantage of schedule(runtime): even when static scheduling is used it @@ -2123,7 +2121,6 @@ static void __kmp_dist_get_bounds(ident_t *loc, kmp_int32 gtid, kmp_int32 *plastiter, T *plower, T *pupper, typename traits_t<T>::signed_t incr) { typedef typename traits_t<T>::unsigned_t UT; - typedef typename traits_t<T>::signed_t ST; kmp_uint32 team_id; kmp_uint32 nteams; UT trip_count; @@ -2133,6 +2130,7 @@ static void __kmp_dist_get_bounds(ident_t *loc, kmp_int32 gtid, KMP_DEBUG_ASSERT(plastiter && plower && pupper); KE_TRACE(10, ("__kmpc_dist_get_bounds called (%d)\n", gtid)); #ifdef KMP_DEBUG + typedef typename traits_t<T>::signed_t ST; { char *buff; // create format specifiers before the debug output @@ -2170,7 +2168,7 @@ static void __kmp_dist_get_bounds(ident_t *loc, kmp_int32 gtid, nteams = th->th.th_teams_size.nteams; #endif team_id = team->t.t_master_tid; - KMP_DEBUG_ASSERT(nteams == team->t.t_parent->t.t_nproc); + KMP_DEBUG_ASSERT(nteams == (kmp_uint32)team->t.t_parent->t.t_nproc); // compute global trip count if (incr == 1) { |

