public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 1/6] Stack align: New data in function.h
@ 2008-04-17  9:01 Ye, Joey
  0 siblings, 0 replies; only message in thread
From: Ye, Joey @ 2008-04-17  9:01 UTC (permalink / raw)
  To: GCC Patches; +Cc: Lu, Hongjiu, Guo, Xuepeng, Ye, Joey

Refer to discussion: 
http://gcc.gnu.org/ml/gcc-patches/2008-04/msg01019.html

Thanks - Joey

2008-04-17  Joey Ye  <joey.ye@intel.com>
	    H.J. Lu  <hongjiu.lu@intel.com>

	* function.h (function): Add new field
stack_alignment_estimated,
	need_frame_pointer, need_frame_pointer_set,
stack_realign_needed,
	stack_realign_really, need_drap, save_param_ptr_reg,
	stack_realign_processed, stack_realign_finalized and 
	stack_realign_used.
	(rtl_data): Add new field drap_reg. 
	(stack_realign_fp): New macro.
	(stack_realign_drap): Likewise.

Index: function.h
===================================================================
--- function.h	(.../trunk/gcc)	(revision 134203)
+++ function.h	(.../branches/stack/gcc)	(revision 134368)
@@ -271,6 +271,9 @@ struct rtl_data GTY(())
      needed by inner routines.  */
   rtx x_arg_pointer_save_area;
 
+  /* Dynamic Realign Argument Pointer used for realigning stack.  */
+  rtx drap_reg;
+
   /* Offset to end of allocated area of stack frame.
      If stack grows down, this is the address of the last stack slot
allocated.
      If stack grows up, this is the address for the next slot.  */
@@ -352,9 +362,16 @@ struct function GTY(())
   /* 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.  */
+  /* The largest alignment needed on the stack, including requirement
+     for outgoing stack alignment.  */
   unsigned int stack_alignment_needed;
 
+  /* The largest alignment of slot allocated on the stack.  */
+  unsigned int stack_alignment_used;
+
+  /* The estimated stack alignment.  */
+  unsigned int stack_alignment_estimated;
+
   /* Preferred alignment of the end of stack frame.  */
   unsigned int preferred_stack_boundary;
 
@@ -509,6 +526,31 @@ struct function GTY(())
 
   /* Nonzero if pass_tree_profile was run on this function.  */
   unsigned int after_tree_profile : 1;
+
+  /* Nonzero if, by estimation, current function stack needs
realignment. */
+  unsigned int stack_realign_needed : 1;
+
+  /* Nonzero if function stack realignment is really needed. This flag
+     will be set after reload if by then criteria of stack realignment
+     is still true. Its value may be contridition to
stack_realign_needed
+     since the latter was set before reload. This flag is more accurate
+     than stack_realign_needed so prologue/epilogue should be generated
+     according to both flags  */
+  unsigned int stack_realign_really : 1;
+
+  /* Nonzero if function being compiled needs dynamic realigned
+     argument pointer (drap) if stack needs realigning.  */
+  unsigned int need_drap : 1;
+
+  /* Nonzero if current function needs to save/restore parameter
+     pointer register in prolog, because it is a callee save reg.  */
+  unsigned int save_param_ptr_reg : 1;
+
+  /* Nonzero if function stack realignment estimatoin is done.  */
+  unsigned int stack_realign_processed : 1;
+
+  /* Nonzero if function stack realignment has been finalized.  */
+  unsigned int stack_realign_finalized : 1;
 };
 
 /* If va_list_[gf]pr_size is set to this, it means we don't know how
@@ -563,6 +605,8 @@ extern void instantiate_decl_rtl (rtx x)
 #define dom_computed (cfun->cfg->x_dom_computed)
 #define n_bbs_in_dom_tree (cfun->cfg->x_n_bbs_in_dom_tree)
 #define VALUE_HISTOGRAMS(fun) (fun)->value_histograms
+#define stack_realign_fp (cfun->stack_realign_needed &&
!cfun->need_drap)
+#define stack_realign_drap (cfun->stack_realign_needed &&
cfun->need_drap)
 
 /* Given a function decl for a containing function,
    return the `struct function' for it.  */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-17  8:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-17  9:01 [PATCH 1/6] Stack align: New data in function.h Ye, Joey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).