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]

Re: patch: RTL loop optimizer - new target hook in doloop_valid_p


	I have committed the following patch to define the hook for PowerPC.

	The one unfortunate aspect of the change is that the hook does not
have a pointed to the dump file to report why doloop could not be applied.

David


	* config/rs6000/rs6000.c (rs6000_insn_valid_within_doloop): New.
	(TARGET_INSN_VALID_WITHIN_DOLOOP): Define.

Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.829
diff -c -p -r1.829 rs6000.c
*** rs6000.c	1 Jun 2005 00:45:16 -0000	1.829
--- rs6000.c	2 Jun 2005 14:14:17 -0000
*************** struct processor_costs power4_cost = {
*** 552,557 ****
--- 552,558 ----
  
  
  static bool rs6000_function_ok_for_sibcall (tree, tree);
+ static bool rs6000_insn_valid_within_doloop (rtx);
  static rtx rs6000_generate_compare (enum rtx_code);
  static void rs6000_maybe_dead (rtx);
  static void rs6000_emit_stack_tie (void);
*************** static const char alt_reg_names[][8] =
*** 906,911 ****
--- 907,915 ----
  #undef TARGET_FUNCTION_OK_FOR_SIBCALL
  #define TARGET_FUNCTION_OK_FOR_SIBCALL rs6000_function_ok_for_sibcall
  
+ #undef TARGET_INSN_VALID_WITHIN_DOLOOP
+ #define TARGET_INSN_VALID_WITHIN_DOLOOP rs6000_insn_valid_within_doloop
+ 
  #undef TARGET_RTX_COSTS
  #define TARGET_RTX_COSTS rs6000_rtx_costs
  #undef TARGET_ADDRESS_COST
*************** rs6000_function_ok_for_sibcall (tree dec
*** 12520,12525 ****
--- 12524,12546 ----
    return false;
  }
  
+ /* TRUE if INSN insn is valid within a low-overhead loop.
+    PowerPC uses the COUNT register for branch on table instructions.  */
+ 
+ static bool
+ rs6000_insn_valid_within_doloop (rtx insn)
+ {
+   if (CALL_P (insn))
+     return false;
+ 
+   if (JUMP_P (insn)
+       && (GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC
+ 	  || GET_CODE (PATTERN (insn)) == ADDR_VEC))
+     return false;
+ 
+   return true;
+ }
+ 
  static int
  rs6000_ra_ever_killed (void)
  {


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