Hello,

While looking at PR 60086 I noticed that we do not print the total scheduling time for the region in selective scheduler as we do for the Haifa scheduler. This is helpful for the PRs analysis and needs only the tiny adjustment so I went ahead and installed the following. Bootstrapped and tested with the patch for PR 60292.

The patch does not actually fixes 60086, just helps with analyzing it, so no mentions of the PR in the changelog.

Andrey
Index: gcc/ChangeLog
===================================================================
*** gcc/ChangeLog       (revision 208109)
--- gcc/ChangeLog       (revision 208110)
***************
*** 1,4 ****
--- 1,11 ----
  2014-02-25  Andrey Belevantsev  <a...@ispras.ru>
+       
+       * sel-sched.c (calculate_new_fences): New parameter ptime.
+       Calculate it as a maximum over all fence cycles.
+       (sel_sched_region_2): Adjust the call to calculate_new_fences.
+       Print the final schedule timing when sched_verbose.
+ 
+ 2014-02-25  Andrey Belevantsev  <a...@ispras.ru>
  
        PR rtl-optimization/60292
        * sel-sched.c (fill_vec_av_set): Do not reset target availability
Index: gcc/sel-sched.c
===================================================================
*** gcc/sel-sched.c     (revision 208109)
--- gcc/sel-sched.c     (revision 208110)
*************** find_min_max_seqno (flist_t fences, int 
*** 7467,7478 ****
      }
  }
  
! /* Calculate new fences from FENCES.  */
  static flist_t
! calculate_new_fences (flist_t fences, int orig_max_seqno)
  {
    flist_t old_fences = fences;
    struct flist_tail_def _new_fences, *new_fences = &_new_fences;
  
    flist_tail_init (new_fences);
    for (; fences; fences = FLIST_NEXT (fences))
--- 7467,7479 ----
      }
  }
  
! /* Calculate new fences from FENCES.  Write the current time to PTIME.  */
  static flist_t
! calculate_new_fences (flist_t fences, int orig_max_seqno, int *ptime)
  {
    flist_t old_fences = fences;
    struct flist_tail_def _new_fences, *new_fences = &_new_fences;
+   int max_time = 0;
  
    flist_tail_init (new_fences);
    for (; fences; fences = FLIST_NEXT (fences))
*************** calculate_new_fences (flist_t fences, in
*** 7501,7509 ****
--- 7502,7512 ----
          }
        else
          extract_new_fences_from (fences, new_fences, orig_max_seqno);
+       max_time = MAX (max_time, FENCE_CYCLE (fence));
      }
  
    flist_clear (&old_fences);
+   *ptime = max_time;
    return FLIST_TAIL_HEAD (new_fences);
  }
  
*************** static void
*** 7558,7563 ****
--- 7561,7567 ----
  sel_sched_region_2 (int orig_max_seqno)
  {
    int highest_seqno_in_use = orig_max_seqno;
+   int max_time = 0;
  
    stat_bookkeeping_copies = 0;
    stat_insns_needed_bookkeeping = 0;
*************** sel_sched_region_2 (int orig_max_seqno)
*** 7573,7591 ****
  
        find_min_max_seqno (fences, &min_seqno, &max_seqno);
        schedule_on_fences (fences, max_seqno, &scheduled_insns_tailp);
!       fences = calculate_new_fences (fences, orig_max_seqno);
        highest_seqno_in_use = update_seqnos_and_stage (min_seqno, max_seqno,
                                                        highest_seqno_in_use,
                                                        &scheduled_insns);
      }
  
    if (sched_verbose >= 1)
!     sel_print ("Scheduled %d bookkeeping copies, %d insns needed "
!                "bookkeeping, %d insns renamed, %d insns substituted\n",
!                stat_bookkeeping_copies,
!                stat_insns_needed_bookkeeping,
!                stat_renamed_scheduled,
!                stat_substitutions_total);
  }
  
  /* Schedule a region.  When pipelining, search for possibly never scheduled
--- 7577,7598 ----
  
        find_min_max_seqno (fences, &min_seqno, &max_seqno);
        schedule_on_fences (fences, max_seqno, &scheduled_insns_tailp);
!       fences = calculate_new_fences (fences, orig_max_seqno, &max_time);
        highest_seqno_in_use = update_seqnos_and_stage (min_seqno, max_seqno,
                                                        highest_seqno_in_use,
                                                        &scheduled_insns);
      }
  
    if (sched_verbose >= 1)
!     {
!       sel_print ("Total scheduling time: %d cycles\n", max_time);
!       sel_print ("Scheduled %d bookkeeping copies, %d insns needed "
!                "bookkeeping, %d insns renamed, %d insns substituted\n",
!                stat_bookkeeping_copies,
!                stat_insns_needed_bookkeeping,
!                stat_renamed_scheduled,
!                stat_substitutions_total);
!     }
  }
  
  /* Schedule a region.  When pipelining, search for possibly never scheduled

Reply via email to