This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cycle_display vs rank_for_schedule


We could get different results depending on whether or not
we were generating cycle_display markers.  Eeep.

As an aside, these markers REALLY should be NOTE_INSN notes
rather than crazy unspecs implemented by the target.  Maybe
I'll fix that today...


r~


        * haifa-sched.c (rank_for_schedule): Skip past last_scheduled_insn
        emitted by cycle_display.

Index: haifa-sched.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/haifa-sched.c,v
retrieving revision 1.195
diff -c -p -d -r1.195 haifa-sched.c
*** haifa-sched.c	29 Apr 2002 22:34:33 -0000	1.195
--- haifa-sched.c	2 May 2002 23:55:45 -0000
*************** rank_for_schedule (x, y)
*** 852,858 ****
  {
    rtx tmp = *(const rtx *) y;
    rtx tmp2 = *(const rtx *) x;
!   rtx link;
    int tmp_class, tmp2_class, depend_count1, depend_count2;
    int val, priority_val, weight_val, info_val;
  
--- 852,858 ----
  {
    rtx tmp = *(const rtx *) y;
    rtx tmp2 = *(const rtx *) x;
!   rtx link, lsi;
    int tmp_class, tmp2_class, depend_count1, depend_count2;
    int val, priority_val, weight_val, info_val;
  
*************** rank_for_schedule (x, y)
*** 871,893 ****
      return info_val;
  
    /* Compare insns based on their relation to the last-scheduled-insn.  */
!   if (last_scheduled_insn)
      {
        /* Classify the instructions into three classes:
           1) Data dependent on last schedule insn.
           2) Anti/Output dependent on last scheduled insn.
           3) Independent of last scheduled insn, or has latency of one.
           Choose the insn from the highest numbered class if different.  */
!       link = find_insn_list (tmp, INSN_DEPEND (last_scheduled_insn));
!       if (link == 0 || insn_cost (last_scheduled_insn, link, tmp) == 1)
  	tmp_class = 3;
        else if (REG_NOTE_KIND (link) == 0)	/* Data dependence.  */
  	tmp_class = 1;
        else
  	tmp_class = 2;
  
!       link = find_insn_list (tmp2, INSN_DEPEND (last_scheduled_insn));
!       if (link == 0 || insn_cost (last_scheduled_insn, link, tmp2) == 1)
  	tmp2_class = 3;
        else if (REG_NOTE_KIND (link) == 0)	/* Data dependence.  */
  	tmp2_class = 1;
--- 871,898 ----
      return info_val;
  
    /* Compare insns based on their relation to the last-scheduled-insn.  */
!   for (lsi = last_scheduled_insn;
!        lsi && INSN_UID (lsi) >= old_max_uid;
!        lsi = PREV_INSN (lsi))
!     continue;
! 
!   if (lsi)
      {
        /* Classify the instructions into three classes:
           1) Data dependent on last schedule insn.
           2) Anti/Output dependent on last scheduled insn.
           3) Independent of last scheduled insn, or has latency of one.
           Choose the insn from the highest numbered class if different.  */
!       link = find_insn_list (tmp, INSN_DEPEND (lsi));
!       if (link == 0 || insn_cost (lsi, link, tmp) == 1)
  	tmp_class = 3;
        else if (REG_NOTE_KIND (link) == 0)	/* Data dependence.  */
  	tmp_class = 1;
        else
  	tmp_class = 2;
  
!       link = find_insn_list (tmp2, INSN_DEPEND (lsi));
!       if (link == 0 || insn_cost (lsi, link, tmp2) == 1)
  	tmp2_class = 3;
        else if (REG_NOTE_KIND (link) == 0)	/* Data dependence.  */
  	tmp2_class = 1;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]