[Openmp-commits] [openmp] r239334 - Remove unused variable warnings by deletion.

Jonathan Peyton jonathan.l.peyton at intel.com
Mon Jun 8 13:01:14 PDT 2015


Author: jlpeyton
Date: Mon Jun  8 15:01:14 2015
New Revision: 239334

URL: http://llvm.org/viewvc/llvm-project?rev=239334&view=rev
Log:
Remove unused variable warnings by deletion.

As an ongoing effort to sanitize the openmp code, these changes delete 
variables that aren't used at all.
http://lists.cs.uiuc.edu/pipermail/openmp-dev/2015-June/000701.html

Patch by Jack Howarth

Modified:
    openmp/trunk/runtime/src/kmp_csupport.c
    openmp/trunk/runtime/src/kmp_error.c
    openmp/trunk/runtime/src/kmp_gsupport.c
    openmp/trunk/runtime/src/kmp_lock.cpp
    openmp/trunk/runtime/src/kmp_runtime.c
    openmp/trunk/runtime/src/kmp_settings.c
    openmp/trunk/runtime/src/kmp_str.c
    openmp/trunk/runtime/src/kmp_tasking.c
    openmp/trunk/runtime/src/kmp_taskq.c
    openmp/trunk/runtime/src/kmp_utility.c
    openmp/trunk/runtime/src/z_Linux_util.c

Modified: openmp/trunk/runtime/src/kmp_csupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_csupport.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_csupport.c (original)
+++ openmp/trunk/runtime/src/kmp_csupport.c Mon Jun  8 15:01:14 2015
@@ -654,7 +654,6 @@ __kmpc_barrier(ident_t *loc, kmp_int32 g
 {
     KMP_COUNT_BLOCK(OMP_BARRIER);
     KMP_TIME_BLOCK(OMP_barrier);
-    int explicit_barrier_flag;
     KC_TRACE( 10, ("__kmpc_barrier: called T#%d\n", global_tid ) );
 
     if (! TCR_4(__kmp_init_parallel))

Modified: openmp/trunk/runtime/src/kmp_error.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_error.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_error.c (original)
+++ openmp/trunk/runtime/src/kmp_error.c Mon Jun  8 15:01:14 2015
@@ -23,24 +23,6 @@
 
 #define MIN_STACK       100
 
-static char const * cons_text_fort[] = {
-    "(none)",
-    "PARALLEL",
-    "work-sharing",             /* this is not called DO because of lowering of SECTIONS and WORKSHARE directives */
-    "ORDERED work-sharing",     /* this is not called DO ORDERED because of lowering of SECTIONS directives */
-    "SECTIONS",
-    "work-sharing",             /* this is not called SINGLE because of lowering of SECTIONS and WORKSHARE directives */
-    "TASKQ",
-    "TASKQ",
-    "TASKQ ORDERED",
-    "CRITICAL",
-    "ORDERED",                  /* in PARALLEL */
-    "ORDERED",                  /* in PDO */
-    "ORDERED",                  /* in TASKQ */
-    "MASTER",
-    "REDUCE",
-    "BARRIER"
-};
 
 static char const * cons_text_c[] = {
     "(none)",
@@ -70,7 +52,6 @@ static char const * cons_text_c[] = {
     cons_text_c[ (p)->stack_data[ tos ].type ],       \
     get_src( (p)->stack_data[ tos ].ident )
 
-static int const cons_text_fort_num = sizeof( cons_text_fort ) / sizeof( char const * );
 static int const cons_text_c_num    = sizeof( cons_text_c    ) / sizeof( char const * );
 
 /* ------------------------------------------------------------------------ */

Modified: openmp/trunk/runtime/src/kmp_gsupport.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_gsupport.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_gsupport.c (original)
+++ openmp/trunk/runtime/src/kmp_gsupport.c Mon Jun  8 15:01:14 2015
@@ -186,7 +186,6 @@ void
 xexpand(KMP_API_NAME_GOMP_SINGLE_COPY_END)(void *data)
 {
     int gtid = __kmp_get_gtid();
-    MKLOC(loc, "GOMP_single_copy_end");
     KA_TRACE(20, ("GOMP_single_copy_end: T#%d\n", gtid));
 
     //
@@ -826,7 +825,6 @@ LOOP_NEXT_ULL(xexpand(KMP_API_NAME_GOMP_
       long lb, long ub, long str, long chunk_sz)                             \
     {                                                                        \
         int gtid = __kmp_entry_gtid();                                       \
-        int last = FALSE;                                                    \
         MKLOC(loc, #func);                                                   \
         KA_TRACE(20, ( #func ": T#%d, lb 0x%lx, ub 0x%lx, str 0x%lx, chunk_sz 0x%lx\n",        \
           gtid, lb, ub, str, chunk_sz ));                                    \
@@ -1023,7 +1021,6 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_SECTI
   unsigned num_threads, unsigned count)
 {
     int gtid = __kmp_entry_gtid();
-    int last = FALSE;
 
 #if OMPT_SUPPORT
     ompt_frame_t *parent_frame;
@@ -1119,7 +1116,6 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_SECTI
   unsigned num_threads, unsigned count, unsigned flags)
 {
     int gtid = __kmp_entry_gtid();
-    int last = FALSE;
     MKLOC(loc, "GOMP_parallel_sections");
     KA_TRACE(20, ("GOMP_parallel_sections: T#%d\n", gtid));
 
@@ -1151,7 +1147,6 @@ xexpand(KMP_API_NAME_GOMP_PARALLEL_SECTI
       long lb, long ub, long str, long chunk_sz, unsigned flags)             \
     {                                                                        \
         int gtid = __kmp_entry_gtid();                                       \
-        int last = FALSE;                                                    \
         MKLOC(loc, #func);                                                   \
         KA_TRACE(20, ( #func ": T#%d, lb 0x%lx, ub 0x%lx, str 0x%lx, chunk_sz 0x%lx\n",        \
           gtid, lb, ub, str, chunk_sz ));                                    \

Modified: openmp/trunk/runtime/src/kmp_lock.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_lock.cpp?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_lock.cpp (original)
+++ openmp/trunk/runtime/src/kmp_lock.cpp Mon Jun  8 15:01:14 2015
@@ -3870,7 +3870,6 @@ __kmp_lock_table_insert( kmp_user_lock_p
     if ( __kmp_user_lock_table.used >= __kmp_user_lock_table.allocated ) {
         kmp_lock_index_t size;
         kmp_user_lock_p *table;
-        kmp_lock_index_t i;
         // Reallocate lock table.
         if ( __kmp_user_lock_table.allocated == 0 ) {
             size = 1024;
@@ -3979,8 +3978,6 @@ __kmp_user_lock_allocate( void **user_lo
 void
 __kmp_user_lock_free( void **user_lock, kmp_int32 gtid, kmp_user_lock_p lck )
 {
-    kmp_lock_pool_t * lock_pool;
-
     KMP_DEBUG_ASSERT( user_lock != NULL );
     KMP_DEBUG_ASSERT( lck != NULL );
 

Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Mon Jun  8 15:01:14 2015
@@ -732,8 +732,6 @@ __kmp_parallel_deo( int *gtid_ref, int *
     }
 #ifdef BUILD_PARALLEL_ORDERED
     if( !team->t.t_serialized ) {
-        kmp_uint32  spins;
-
         KMP_MB();
         KMP_WAIT_YIELD(&team->t.t_ordered.dt.t_value, __kmp_tid_from_gtid( gtid ), KMP_EQ, NULL);
         KMP_MB();
@@ -1288,7 +1286,6 @@ __kmp_serialized_parallel(ident_t *loc,
             /* this serial team was already used
              * TODO increase performance by making this locks more specific */
             kmp_team_t *new_team;
-            int tid = this_thr->th.th_info.ds.ds_tid;
 
             __kmp_acquire_bootstrap_lock( &__kmp_forkjoin_lock );
 
@@ -2749,7 +2746,6 @@ __kmp_get_schedule( int gtid, kmp_sched_
 {
     kmp_info_t     *thread;
     enum sched_type th_type;
-    int             i;
 
     KF_TRACE( 10, ("__kmp_get_schedule: thread %d\n", gtid ));
     KMP_DEBUG_ASSERT( __kmp_init_serial );
@@ -3119,7 +3115,6 @@ __kmp_initialize_root( kmp_root_t *root
     int           f;
     kmp_team_t   *root_team;
     kmp_team_t   *hot_team;
-    size_t        disp_size, dispatch_size, bar_size;
     int           hot_team_max_nth;
     kmp_r_sched_t r_sched = __kmp_get_schedule_global(); // get current state of scheduling globals
     kmp_internal_control_t r_icvs = __kmp_get_global_icvs();
@@ -4766,8 +4761,6 @@ __kmp_allocate_team( kmp_root_t *root, i
     KMP_TIME_BLOCK(KMP_allocate_team);
     int f;
     kmp_team_t *team;
-    char *ptr;
-    size_t size;
     int use_hot_team = ! root->r.r_active;
     int level = 0;
 
@@ -5911,8 +5904,6 @@ __kmp_internal_end(void)
 void
 __kmp_internal_end_library( int gtid_req )
 {
-    int i;
-
     /* if we have already cleaned up, don't try again, it wouldn't be pretty */
     /* this shouldn't be a race condition because __kmp_internal_end() is the
      * only place to clear __kmp_serial_init */

Modified: openmp/trunk/runtime/src/kmp_settings.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_settings.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_settings.c (original)
+++ openmp/trunk/runtime/src/kmp_settings.c Mon Jun  8 15:01:14 2015
@@ -1582,7 +1582,6 @@ static void
 __kmp_stg_print_force_reduction( kmp_str_buf_t * buffer, char const * name, void * data ) {
 
     kmp_stg_fr_data_t * reduction = (kmp_stg_fr_data_t *) data;
-    char const *        value = NULL;
     if ( reduction->force ) {
         if( __kmp_force_reduction_method == critical_reduce_block) {
             __kmp_stg_print_str( buffer, name, "critical");
@@ -3998,7 +3997,6 @@ __kmp_stg_parse_adaptive_lock_props( con
     int max_badness = 0;
 
     const char *next = value;
-    const char *scan = next;
 
     int total = 0;          // Count elements that were set. It'll be used as an array size
     int prev_comma = FALSE; // For correct processing sequential commas
@@ -5232,7 +5230,6 @@ void
 __kmp_env_print_2() {
 
     kmp_env_blk_t block;
-    int           i;
     kmp_str_buf_t buffer;
 
     __kmp_env_format = 1;

Modified: openmp/trunk/runtime/src/kmp_str.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_str.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_str.c (original)
+++ openmp/trunk/runtime/src/kmp_str.c Mon Jun  8 15:01:14 2015
@@ -275,7 +275,6 @@ __kmp_str_buf_print_size(
     char const * names[] = { "", "k", "M", "G", "T", "P", "E", "Z", "Y" };
     int const    units   = sizeof( names ) / sizeof( char const * );
     int          u       = 0;
-    int          rc;
     if ( size > 0 ) {
         while ( ( size % 1024 == 0 ) && ( u + 1 < units ) ) {
             size = size / 1024;
@@ -733,7 +732,6 @@ __kmp_str_to_size(         // R: Error c
     size_t value    = 0;
     size_t factor   = 0;
     int    overflow = 0;
-    int    bad_unit = 0;
     int    i        = 0;
     int    digit;
 

Modified: openmp/trunk/runtime/src/kmp_tasking.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_tasking.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_tasking.c (original)
+++ openmp/trunk/runtime/src/kmp_tasking.c Mon Jun  8 15:01:14 2015
@@ -1563,7 +1563,7 @@ __kmp_steal_task( kmp_info_t *victim, km
     kmp_task_t * task;
     kmp_taskdata_t * taskdata;
     kmp_thread_data_t *victim_td, *threads_data;
-    kmp_int32 victim_tid, thread_tid;
+    kmp_int32 victim_tid;
 
     KMP_DEBUG_ASSERT( __kmp_tasking_mode != tskm_immediate_exec );
 
@@ -1676,7 +1676,6 @@ static inline int __kmp_execute_tasks_te
                                                USE_ITT_BUILD_ARG(void * itt_sync_obj), kmp_int32 is_constrained)
 {
     kmp_task_team_t *     task_team;
-    kmp_team_t *          team;
     kmp_thread_data_t *   threads_data;
     kmp_task_t *          task;
     kmp_taskdata_t *      current_task = thread -> th.th_current_task;

Modified: openmp/trunk/runtime/src/kmp_taskq.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_taskq.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_taskq.c (original)
+++ openmp/trunk/runtime/src/kmp_taskq.c Mon Jun  8 15:01:14 2015
@@ -42,7 +42,6 @@ __kmp_taskq_eo( int *gtid_ref, int *cid_
 {
     int                gtid = *gtid_ref;
     int                tid  = __kmp_tid_from_gtid( gtid );
-    kmp_uint32         spins;
     kmp_uint32         my_token;
     kmpc_task_queue_t *taskq;
     kmp_taskq_t       *tq   = & __kmp_threads[gtid] -> th.th_team -> t.t_taskq;
@@ -99,7 +98,6 @@ __kmp_taskq_xo( int *gtid_ref, int *cid_
 static void
 __kmp_taskq_check_ordered( kmp_int32 gtid, kmpc_thunk_t *thunk )
 {
-    kmp_uint32 spins;
     kmp_uint32 my_token;
     kmpc_task_queue_t *taskq;
 
@@ -1080,8 +1078,6 @@ __kmp_remove_queue_from_tree( kmp_taskq_
     queue->tq_next_child = NULL;
 
     if (in_parallel) {
-        kmp_uint32 spins;
-
         KMP_DEBUG_REF_CTS(("line %d gtid %d: Q %p waiting for ref_count of %d to reach 1\n",
           __LINE__, global_tid, queue, queue->tq_ref_count));
 
@@ -1387,8 +1383,6 @@ __kmpc_taskq( ident_t *loc, kmp_int32 gl
         /* master thread only executes this code */
 
         if( tq->tq_curr_thunk_capacity < nproc ) {
-            int i;
-
             if(tq->tq_curr_thunk)
                 __kmp_free(tq->tq_curr_thunk);
             else {

Modified: openmp/trunk/runtime/src/kmp_utility.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_utility.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_utility.c (original)
+++ openmp/trunk/runtime/src/kmp_utility.c Mon Jun  8 15:01:14 2015
@@ -80,7 +80,6 @@ __kmp_get_logical_id( int log_per_phy, i
 {
    unsigned current_bit;
    int bits_seen;
-   unsigned mask;
 
    if (log_per_phy <= 1) return ( 0 );
 

Modified: openmp/trunk/runtime/src/z_Linux_util.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/z_Linux_util.c?rev=239334&r1=239333&r2=239334&view=diff
==============================================================================
--- openmp/trunk/runtime/src/z_Linux_util.c (original)
+++ openmp/trunk/runtime/src/z_Linux_util.c Mon Jun  8 15:01:14 2015
@@ -687,7 +687,6 @@ __kmp_launch_worker( void *thr )
     void *padding = 0;
 #endif
     int gtid;
-    int error;
 
     gtid = ((kmp_info_t*)thr) -> th.th_info.ds.ds_gtid;
     __kmp_gtid_set_specific( gtid );
@@ -766,7 +765,6 @@ __kmp_launch_monitor( void *thr )
     struct timespec  interval;
     int yield_count;
     int yield_cycles = 0;
-    int error;
 
     KMP_MB();       /* Flush all pending memory write invalidates.  */
 
@@ -1278,7 +1276,7 @@ void __kmp_resume_monitor();
 void
 __kmp_reap_monitor( kmp_info_t *th )
 {
-    int          status, i;
+    int          status;
     void        *exit_val;
 
     KA_TRACE( 10, ("__kmp_reap_monitor: try to reap monitor thread with handle %#.8lx\n",





More information about the Openmp-commits mailing list