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] Shrink struct function


by removing old RTL liner cruft and re-ordering bool and enum into
the bitfield section (thereby aligning the two :8 members at byte
boundary) and re-ordering int's to avoid padding.  struct function
is actually one of the most used structures for tramp3d.

Bootstrapped and tested on i686-pc-linux-gnu.

Ok for mainline?

Thanks,
Richard.

:ADDPATCH middle-end:

2006-06-15  Richard Guenther  <rguenther@suse.de>

	* function.h (enum function_frequency): Move declaration
	out of struct function.
	(struct function): Move bool fields and the enum to the bitfield
	section.  Reorder elements to avoid padding.  Remove unused
	fields left over from the RTL inliner removal.
	* Makefile.in (ipa-reference.o): Add $(FUNCTION_H) dependency.
	(ipa-type-escape.o): Likewise.

Index: function.h
===================================================================
*** function.h	(revision 114684)
--- function.h	(working copy)
*************** typedef struct temp_slot *temp_slot_p;
*** 165,170 ****
--- 165,181 ----
  DEF_VEC_P(temp_slot_p);
  DEF_VEC_ALLOC_P(temp_slot_p,gc);
  
+ enum function_frequency {
+   /* This function most likely won't be executed at all.
+      (set only when profile feedback is available).  */
+   FUNCTION_FREQUENCY_UNLIKELY_EXECUTED,
+   /* The default value.  */
+   FUNCTION_FREQUENCY_NORMAL,
+   /* Optimize this function hard
+      (set only when profile feedback is available).  */
+   FUNCTION_FREQUENCY_HOT
+ };
+ 
  /* This structure can save all the important global and static variables
     describing the status of the current function.  */
  
*************** struct function GTY(())
*** 177,183 ****
  
    /* The control flow graph for this function.  */
    struct control_flow_graph *cfg;
-   bool after_inlining;
  
    /* For function.c.  */
  
--- 188,193 ----
*************** struct function GTY(())
*** 277,294 ****
    /* List of available temp slots.  */
    struct temp_slot *x_avail_temp_slots;
  
-   /* Current nesting level for temporaries.  */
-   int x_temp_slot_level;
- 
    /* This slot is initialized as 0 and is added to
       during the nested function.  */
    struct var_refs_queue *fixup_var_refs_queue;
  
!   /* For integrate.c.  */
!   int inlinable;
!   int no_debugging_symbols;
!   rtvec original_arg_vector;
!   tree original_decl_initial;
  
    /* Highest label number in current function.  */
    int inl_max_label_num;
--- 287,298 ----
    /* List of available temp slots.  */
    struct temp_slot *x_avail_temp_slots;
  
    /* This slot is initialized as 0 and is added to
       during the nested function.  */
    struct var_refs_queue *fixup_var_refs_queue;
  
!   /* Current nesting level for temporaries.  */
!   int x_temp_slot_level;
  
    /* Highest label number in current function.  */
    int inl_max_label_num;
*************** struct function GTY(())
*** 307,320 ****
  
    /* tm.h can use this to store whatever it likes.  */
    struct machine_function * GTY ((maybe_undef)) machine;
    /* The largest alignment of slot allocated on the stack.  */
    unsigned int stack_alignment_needed;
    /* Preferred alignment of the end of stack frame.  */
    unsigned int preferred_stack_boundary;
-   /* Set when the call to function itself has been emit.  */
-   bool recursive_call_emit;
-   /* Set when the tail call has been produced.  */
-   bool tail_call_emit;
  
    /* Language-specific code can use this to store whatever it likes.  */
    struct language_function * language;
--- 311,322 ----
  
    /* tm.h can use this to store whatever it likes.  */
    struct machine_function * GTY ((maybe_undef)) machine;
+ 
    /* The largest alignment of slot allocated on the stack.  */
    unsigned int stack_alignment_needed;
+ 
    /* Preferred alignment of the end of stack frame.  */
    unsigned int preferred_stack_boundary;
  
    /* Language-specific code can use this to store whatever it likes.  */
    struct language_function * language;
*************** struct function GTY(())
*** 328,346 ****
       delay list for them is recorded here.  */
    rtx epilogue_delay_list;
  
-   /* How commonly executed the function is.  Initialized during branch
-      probabilities pass.  */
-   enum function_frequency {
-     /* This function most likely won't be executed at all.
-        (set only when profile feedback is available).  */
-     FUNCTION_FREQUENCY_UNLIKELY_EXECUTED,
-     /* The default value.  */
-     FUNCTION_FREQUENCY_NORMAL,
-     /* Optimize this function hard
-        (set only when profile feedback is available).  */
-     FUNCTION_FREQUENCY_HOT
-   } function_frequency;
- 
    /* Maximal number of entities in the single jumptable.  Used to estimate
       final flowgraph size.  */
    int max_jumptable_ents;
--- 330,335 ----
*************** struct function GTY(())
*** 454,459 ****
--- 443,460 ----
    /* Nonzero if code to initialize arg_pointer_save_area has been emitted.  */
    unsigned int arg_pointer_save_area_init : 1;
  
+   unsigned int after_inlining : 1;
+ 
+   /* Set when the call to function itself has been emit.  */
+   unsigned int recursive_call_emit : 1;
+ 
+   /* Set when the tail call has been produced.  */
+   unsigned int tail_call_emit : 1;
+ 
+   /* How commonly executed the function is.  Initialized during branch
+      probabilities pass.  */
+   ENUM_BITFIELD (function_frequency) function_frequency : 2;
+ 
    /* Number of units of general registers that need saving in stdarg
       function.  What unit is depends on the backend, either it is number
       of bytes, or it can be number of registers.  */
Index: function.c
===================================================================
*** function.c	(revision 114684)
--- function.c	(working copy)
*************** free_after_compilation (struct function 
*** 332,339 ****
    f->x_stack_check_probe_note = NULL;
    f->x_arg_pointer_save_area = NULL;
    f->x_parm_birth_insn = NULL;
-   f->original_arg_vector = NULL;
-   f->original_decl_initial = NULL;
    f->epilogue_delay_list = NULL;
  }
  
--- 332,337 ----
Index: Makefile.in
===================================================================
*** Makefile.in	(revision 114684)
--- Makefile.in	(working copy)
*************** ipa-utils.o : ipa-utils.c $(IPA_UTILS_H)
*** 2306,2312 ****
  ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
     pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(C_COMMON_H) \
!    $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H)  
  ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
     pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) $(TARGET_H) \
--- 2306,2314 ----
  ipa-reference.o : ipa-reference.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
     pointer-set.h $(GGC_H) $(IPA_REFERENCE_H) $(IPA_UTILS_H) $(C_COMMON_H) \
!    $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \
!    $(DIAGNOSTIC_H) $(FUNCTION_H) 
! 
  ipa-pure-const.o : ipa-pure-const.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
     pointer-set.h $(GGC_H) $(IPA_UTILS_H) $(C_COMMON_H) $(TARGET_H) \
*************** ipa-pure-const.o : ipa-pure-const.c $(CO
*** 2314,2320 ****
  ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
     pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(C_COMMON_H) \
!    $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h $(DIAGNOSTIC_H)  
  coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
     $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
     $(FUNCTION_H) toplev.h $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \
--- 2316,2324 ----
  ipa-type-escape.o : ipa-type-escape.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(TREE_FLOW_H) $(TREE_INLINE_H) langhooks.h \
     pointer-set.h $(GGC_H) $(IPA_TYPE_ESCAPE_H) $(IPA_UTILS_H) $(C_COMMON_H) \
!    $(TREE_GIMPLE_H) $(CGRAPH_H) output.h $(FLAGS_H) tree-pass.h \
!    $(DIAGNOSTIC_H) $(FUNCTION_H) 
! 
  coverage.o : coverage.c $(GCOV_IO_H) $(CONFIG_H) $(SYSTEM_H) coretypes.h \
     $(TM_H) $(RTL_H) $(TREE_H) $(FLAGS_H) output.h $(REGS_H) $(EXPR_H) \
     $(FUNCTION_H) toplev.h $(GGC_H) langhooks.h $(COVERAGE_H) gt-coverage.h \


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