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]

[PATCH] genatomata patch for correct max_insn_queue_index generation.


  The following patch fixes one minor problem with the dfa-based insn
scheduler.  The scheduler queue length should be max (latency times,
reservation lengths).  Usually max (latency times) == max (reservation
lengths) but descriptions where max (latency times) > max (reservation
lengths) may exist.  In such case, the scheduler would have generated
correct but in general worse code.

  The patch has been tested on x86, alpha, sparc, sh-elf, and pa.

  I've committed the patch into the main line.

2002-07-05  Vladimir Makarov  <vmakarov@redhat.com>

	* genautomata.c (output_max_insn_queue_index_def): Take latencies
	into account.

Index: genautomata.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/genautomata.c,v
retrieving revision 1.18
diff -c -p -r1.18 genautomata.c
*** genautomata.c	22 Jun 2002 03:08:21 -0000	1.18
--- genautomata.c	5 Jul 2002 20:57:08 -0000
*************** process_state_longest_path_length (state
*** 6872,6878 ****
      max_dfa_issue_rate = value;
  }
  
! /* The following nacro value is name of the corresponding global
     variable in the automaton based pipeline interface.  */
  
  #define MAX_DFA_ISSUE_RATE_VAR_NAME "max_dfa_issue_rate"
--- 6872,6878 ----
      max_dfa_issue_rate = value;
  }
  
! /* The following macro value is name of the corresponding global
     variable in the automaton based pipeline interface.  */
  
  #define MAX_DFA_ISSUE_RATE_VAR_NAME "max_dfa_issue_rate"
*************** output_tables ()
*** 7960,7972 ****
  }
  
  /* The function outputs definition and value of PHR interface variable
!    `max_insn_queue_index' */
  static void
  output_max_insn_queue_index_def ()
  {
!   int i;
  
!   for (i = 0; (1 << i) <= description->max_insn_reserv_cycles; i++)
      ;
    if (i < 0)
      abort ();
--- 7960,7991 ----
  }
  
  /* The function outputs definition and value of PHR interface variable
!    `max_insn_queue_index'.  Its value is not less than maximal queue
!    length needed for the insn scheduler.  */
  static void
  output_max_insn_queue_index_def ()
  {
!   int i, max, latency;
!   decl_t decl;
  
!   max = description->max_insn_reserv_cycles;
!   for (i = 0; i < description->decls_num; i++)
!     {
!       decl = description->decls [i];
!       if (decl->mode == dm_insn_reserv && decl != advance_cycle_insn_decl)
! 	{
! 	  latency = DECL_INSN_RESERV (decl)->default_latency;
! 	  if (latency > max)
! 	    max = latency;
! 	}
!       else if (decl->mode == dm_bypass)
! 	{
! 	  latency = DECL_BYPASS (decl)->latency;
! 	  if (latency > max)
! 	    max = latency;
! 	}
!     }
!   for (i = 0; (1 << i) <= max; i++)
      ;
    if (i < 0)
      abort ();


Vlad


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