Move USE_DFA target hooks to hook_int_void_1, ie. always true.

Steven Bosscher stevenb@suse.de
Tue Jul 6 20:01:00 GMT 2004


Hello,

This moves the backends that had hooks always returning true
to hook_int_void_1.  Mostly mechanical as anyone can see from
the ChangeLog entry, but also two behavior changes, for SPARC
and ix86.

This patch changes the behavior of the SPARC and ix86 backends
for CPUs without a scheduler description.  Without the patch,
the scheduler assumes a ready latency of 1 for all insns without
a matching define_function_unit, and with this patch all those
insns have a ready latency of 0.  I don't think it matters much.
I compared the results for Pentium4, but I did not find any
significant differences in the performance of the resulting code.

Of course Pentium4 is out-of-order and I don't know if SPARC is.
But if anyone cares, just write a dummy DFA description for the
remaining SPARC cpus :-)

Bootstrapped+tested on i686-pc-linux-gnu.  OK?

Gr.
Steven

        * config/alpha/alpha.c (alpha_use_dfa_pipeline_interface): Remove.
        (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
	* config/arm/arm.c (arm_use_dfa_pipeline_interface): Remove.
	(TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
	* config/frv/frv.c (frv_use_dfa_pipeline_interface): Remove.
	(TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
        * config/i386/i386.c (ia32_use_dfa_pipeline_interface): Remove.
        (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
	* config/ia64/ia64.c (ia64_use_dfa_pipeline_interface): Remove.
        (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
	* config/pa/pa.c (hhpa_use_dfa_pipeline_interface): Remove.
        (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
	* config/sparc/sparc.c (sparc_use_dfa_pipeline_interface): Remove.
        (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.
	* config/v850/v850.c (v850_use_dfa_pipeline_interface): Remove.
        (TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE): Define to hook_int_void_1.

Index: config/alpha/alpha.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/alpha/alpha.c,v
retrieving revision 1.372
diff -c -3 -p -r1.372 alpha.c
*** config/alpha/alpha.c	4 Jul 2004 08:07:00 -0000	1.372
--- config/alpha/alpha.c	6 Jul 2004 19:46:27 -0000
*************** alpha_issue_rate (void)
*** 5047,5058 ****
    return (alpha_cpu == PROCESSOR_EV4 ? 2 : 4);
  }
  
- static int
- alpha_use_dfa_pipeline_interface (void)
- {
-   return true;
- }
- 
  /* How many alternative schedules to try.  This should be as wide as the
     scheduling freedom in the DFA, but no wider.  Making this value too
     large results extra work for the scheduler.
--- 5047,5052 ----
*************** alpha_init_libfuncs (void)
*** 10130,10137 ****
  #undef TARGET_SCHED_ISSUE_RATE
  #define TARGET_SCHED_ISSUE_RATE alpha_issue_rate
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \
!   alpha_use_dfa_pipeline_interface
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
    alpha_multipass_dfa_lookahead
--- 10124,10130 ----
  #undef TARGET_SCHED_ISSUE_RATE
  #define TARGET_SCHED_ISSUE_RATE alpha_issue_rate
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
    alpha_multipass_dfa_lookahead
Index: config/arm/arm.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/arm/arm.c,v
retrieving revision 1.370
diff -c -3 -p -r1.370 arm.c
*** config/arm/arm.c	4 Jul 2004 08:07:01 -0000	1.370
--- config/arm/arm.c	6 Jul 2004 19:46:27 -0000
*************** static bool arm_cookie_has_size (void);
*** 213,219 ****
  #define TARGET_SCHED_ADJUST_COST arm_adjust_cost
  
  #undef  TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE 
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE arm_use_dfa_pipeline_interface
  
  #undef TARGET_ENCODE_SECTION_INFO
  #ifdef ARM_PE
--- 213,219 ----
  #define TARGET_SCHED_ADJUST_COST arm_adjust_cost
  
  #undef  TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE 
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  
  #undef TARGET_ENCODE_SECTION_INFO
  #ifdef ARM_PE
*************** arm_address_cost (rtx x)
*** 4130,4141 ****
  }
  
  static int
- arm_use_dfa_pipeline_interface (void)
- {
-   return true;
- }
- 
- static int
  arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost)
  {
    rtx i_pat, d_pat;
--- 4130,4135 ----
Index: config/frv/frv.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/frv/frv.c,v
retrieving revision 1.57
diff -c -3 -p -r1.57 frv.c
*** config/frv/frv.c	4 Jul 2004 08:07:05 -0000	1.57
--- config/frv/frv.c	6 Jul 2004 19:46:27 -0000
*************** static void frv_registers_update		(rtx, 
*** 262,268 ****
  static int frv_registers_used_p			(rtx, unsigned char [], int);
  static int frv_registers_set_p			(rtx, unsigned char [], int);
  static int frv_issue_rate			(void);
- static int frv_use_dfa_pipeline_interface	(void);
  static void frv_pack_insns			(void);
  static void frv_function_prologue		(FILE *, HOST_WIDE_INT);
  static void frv_function_epilogue		(FILE *, HOST_WIDE_INT);
--- 262,267 ----
*************** static rtx frv_struct_value_rtx			(tree,
*** 318,324 ****
  #undef  TARGET_SCHED_ISSUE_RATE
  #define TARGET_SCHED_ISSUE_RATE frv_issue_rate
  #undef  TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE frv_use_dfa_pipeline_interface
  
  #undef TARGET_FUNCTION_OK_FOR_SIBCALL
  #define TARGET_FUNCTION_OK_FOR_SIBCALL frv_function_ok_for_sibcall
--- 317,323 ----
  #undef  TARGET_SCHED_ISSUE_RATE
  #define TARGET_SCHED_ISSUE_RATE frv_issue_rate
  #undef  TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  
  #undef TARGET_FUNCTION_OK_FOR_SIBCALL
  #define TARGET_FUNCTION_OK_FOR_SIBCALL frv_function_ok_for_sibcall
*************** frv_issue_rate (void)
*** 8366,8380 ****
        return 4;
      }
  }
- 
- 
- /* Implement TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE.  */
- 
- static int
- frv_use_dfa_pipeline_interface (void)
- {
-   return true;
- }
  
  /* Update the register state information, to know about which registers are set
     or clobbered.  */
--- 8365,8370 ----
Index: config/i386/i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.679
diff -c -3 -p -r1.679 i386.c
*** config/i386/i386.c	23 Jun 2004 02:27:22 -0000	1.679
--- config/i386/i386.c	6 Jul 2004 19:46:27 -0000
*************** static rtx ix86_expand_aligntest (rtx, i
*** 866,872 ****
  static void ix86_expand_strlensi_unroll_1 (rtx, rtx, rtx);
  static int ix86_issue_rate (void);
  static int ix86_adjust_cost (rtx, rtx, rtx, int);
- static int ia32_use_dfa_pipeline_interface (void);
  static int ia32_multipass_dfa_lookahead (void);
  static void ix86_init_mmx_sse_builtins (void);
  static rtx x86_this_parameter (tree);
--- 866,871 ----
*************** static void init_ext_80387_constants (vo
*** 1018,1025 ****
  #undef TARGET_SCHED_ISSUE_RATE
  #define TARGET_SCHED_ISSUE_RATE ix86_issue_rate
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE \
!   ia32_use_dfa_pipeline_interface
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
    ia32_multipass_dfa_lookahead
--- 1017,1023 ----
  #undef TARGET_SCHED_ISSUE_RATE
  #define TARGET_SCHED_ISSUE_RATE ix86_issue_rate
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD \
    ia32_multipass_dfa_lookahead
*************** ix86_adjust_cost (rtx insn, rtx link, rt
*** 12387,12403 ****
    return cost;
  }
  
- static int
- ia32_use_dfa_pipeline_interface (void)
- {
-   if (TARGET_PENTIUM
-       || TARGET_PENTIUMPRO
-       || TARGET_K6
-       || TARGET_ATHLON_K8)
-     return 1;
-   return 0;
- }
- 
  /* How many alternative schedules to try.  This should be as wide as the
     scheduling freedom in the DFA, but no wider.  Making this value too
     large results extra work for the scheduler.  */
--- 12385,12390 ----
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.296
diff -c -3 -p -r1.296 ia64.c
*** config/ia64/ia64.c	4 Jul 2004 08:07:06 -0000	1.296
--- config/ia64/ia64.c	6 Jul 2004 19:46:27 -0000
*************** struct ia64_frame_info
*** 164,170 ****
  /* Current frame information calculated by ia64_compute_frame_size.  */
  static struct ia64_frame_info current_frame_info;
  
- static int ia64_use_dfa_pipeline_interface (void);
  static int ia64_first_cycle_multipass_dfa_lookahead (void);
  static void ia64_dependencies_evaluation_hook (rtx, rtx);
  static void ia64_init_dfa_pre_cycle_insn (void);
--- 164,169 ----
*************** static const struct attribute_spec ia64_
*** 342,348 ****
  #define TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK ia64_dependencies_evaluation_hook
  
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE ia64_use_dfa_pipeline_interface
  
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ia64_first_cycle_multipass_dfa_lookahead
--- 341,347 ----
  #define TARGET_SCHED_DEPENDENCIES_EVALUATION_HOOK ia64_dependencies_evaluation_hook
  
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD ia64_first_cycle_multipass_dfa_lookahead
*************** final_emit_insn_group_barriers (FILE *du
*** 7374,7388 ****
     insn scheduler.  */
  
  static int
- ia64_use_dfa_pipeline_interface (void)
- {
-   return 1;
- }
- 
- /* If the following function returns TRUE, we will use the the DFA
-    insn scheduler.  */
- 
- static int
  ia64_first_cycle_multipass_dfa_lookahead (void)
  {
    return (reload_completed ? 6 : 4);
--- 7373,7378 ----
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.253
diff -c -3 -p -r1.253 pa.c
*** config/pa/pa.c	1 Jul 2004 02:24:56 -0000	1.253
--- config/pa/pa.c	6 Jul 2004 19:46:27 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 48,63 ****
  #include "target.h"
  #include "target-def.h"
  
- static int hppa_use_dfa_pipeline_interface (void);
- 
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE 
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hppa_use_dfa_pipeline_interface
! 
! static int
! hppa_use_dfa_pipeline_interface (void)
! {
!   return 1;
! }
  
  /* Return nonzero if there is a bypass for the output of 
     OUT_INSN and the fp store IN_INSN.  */
--- 48,55 ----
  #include "target.h"
  #include "target-def.h"
  
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE 
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  
  /* Return nonzero if there is a bypass for the output of 
     OUT_INSN and the fp store IN_INSN.  */
Index: config/sparc/sparc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/sparc/sparc.c,v
retrieving revision 1.310
diff -c -3 -p -r1.310 sparc.c
*** config/sparc/sparc.c	6 Jul 2004 12:51:03 -0000	1.310
--- config/sparc/sparc.c	6 Jul 2004 19:46:28 -0000
*************** static void sparc_elf_asm_named_section 
*** 161,167 ****
  static int sparc_adjust_cost (rtx, rtx, rtx, int);
  static int sparc_issue_rate (void);
  static void sparc_sched_init (FILE *, int, int);
- static int sparc_use_dfa_pipeline_interface (void);
  static int sparc_use_sched_lookahead (void);
  
  static void emit_soft_tfmode_libcall (const char *, int, rtx *);
--- 161,166 ----
*************** enum processor_type sparc_cpu;
*** 242,248 ****
  #undef TARGET_SCHED_INIT
  #define TARGET_SCHED_INIT sparc_sched_init
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE sparc_use_dfa_pipeline_interface
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD sparc_use_sched_lookahead
  
--- 241,247 ----
  #undef TARGET_SCHED_INIT
  #define TARGET_SCHED_INIT sparc_sched_init
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  #undef TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD
  #define TARGET_SCHED_FIRST_CYCLE_MULTIPASS_DFA_LOOKAHEAD sparc_use_sched_lookahead
  
*************** sparc_sched_init (FILE *dump ATTRIBUTE_U
*** 7449,7466 ****
  }
    
  static int
- sparc_use_dfa_pipeline_interface (void)
- {
-   if ((1 << sparc_cpu) &
-       ((1 << PROCESSOR_ULTRASPARC) | (1 << PROCESSOR_CYPRESS) |
-        (1 << PROCESSOR_SUPERSPARC) | (1 << PROCESSOR_HYPERSPARC) |
-        (1 << PROCESSOR_SPARCLITE86X) | (1 << PROCESSOR_TSC701) |
-        (1 << PROCESSOR_ULTRASPARC3)))
-     return 1;
-   return 0;
- }
- 
- static int
  sparc_use_sched_lookahead (void)
  {
    if (sparc_cpu == PROCESSOR_ULTRASPARC
--- 7448,7453 ----
Index: config/v850/v850.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/v850/v850.c,v
retrieving revision 1.89
diff -c -3 -p -r1.89 v850.c
*** config/v850/v850.c	5 Jun 2004 16:35:55 -0000	1.89
--- config/v850/v850.c	6 Jul 2004 19:46:28 -0000
*************** static void v850_insert_attributes   (tr
*** 64,70 ****
  static void v850_select_section (tree, int, unsigned HOST_WIDE_INT);
  static void v850_encode_data_area    (tree, rtx);
  static void v850_encode_section_info (tree, rtx, int);
- static int  v850_use_dfa_pipeline_interface (void);
  static bool v850_return_in_memory    (tree, tree);
  static void v850_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
  					 tree, int *, int);
--- 64,69 ----
*************** static int v850_interrupt_p = FALSE;
*** 119,125 ****
  #define TARGET_ADDRESS_COST hook_int_rtx_0
  
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE v850_use_dfa_pipeline_interface
  
  #undef TARGET_MACHINE_DEPENDENT_REORG
  #define TARGET_MACHINE_DEPENDENT_REORG v850_reorg
--- 118,124 ----
  #define TARGET_ADDRESS_COST hook_int_rtx_0
  
  #undef TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE
! #define TARGET_SCHED_USE_DFA_PIPELINE_INTERFACE hook_int_void_1
  
  #undef TARGET_MACHINE_DEPENDENT_REORG
  #define TARGET_MACHINE_DEPENDENT_REORG v850_reorg
*************** v850_encode_section_info (tree decl, rtx
*** 2345,2356 ****
      v850_encode_data_area (decl, XEXP (rtl, 0));
  }
  
- static int
- v850_use_dfa_pipeline_interface (void)
- {
-   return 1;
- }
- 
  /* Return true if the given RTX is a register which can be restored
     by a function epilogue.  */
  int
--- 2344,2349 ----



More information about the Gcc-patches mailing list