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]

[tree-ssa PATCH] Pick memory consumption low hanging fruit


We can safely use lang_flags for SSA form specific tree nodes.

Bootstrapped-'n'-tested all tree-ssa front ends on i686-pc-linux-gnu,
OK to commit?

Gr.
Steven


2003-11-17  Steven Bosscher  <stevenb@suse.de>

	* tree.h (SSA_NAME_OCCURS_IN_ABNORMAL_PHI): Use lang_flag_6
	from tree_common.
	(struct tree_ssa_name): Remove `occurs_in_abnormal_phi' field.
	(PHI_REWRITTEN): Also use lang_flag_6 from tree_common.
	(struct tree_phi_node): Remove `rewritten' field.
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.128
diff -c -3 -p -r1.342.2.128 tree.h
*** tree.h	17 Nov 2003 07:17:22 -0000	1.342.2.128
--- tree.h	17 Nov 2003 10:12:53 -0000
*************** struct tree_exp GTY(())
*** 1004,1025 ****
      operands[1];
  };
  
! /* SSA_NAME accessors.  SSA_NAME_VAR returns the variable being
!    referenced.  SSA_NAME_DEF_STMT returns the statement that defines
!    this reference.  */
  #define SSA_NAME_VAR(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.var
  #define SSA_NAME_DEF_STMT(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
  #define SSA_NAME_VERSION(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.version
  #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
!     SSA_NAME_CHECK (NODE)->ssa_name.occurs_in_abnormal_phi
  
  struct tree_ssa_name GTY(())
  {
    struct tree_common common;
  
-   /* Nonzero if the SSA name occurs in an abnormal PHI.  */
-   unsigned occurs_in_abnormal_phi : 1;
- 
    /* _DECL wrapped by this SSA name.  */
    tree var;
  
--- 1004,1031 ----
      operands[1];
  };
  
! /* SSA_NAME accessors.  */
! 
! /* Returns the variable being referenced.  */
  #define SSA_NAME_VAR(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.var
+ 
+ /* Returns the statement that defines this reference.  */
  #define SSA_NAME_DEF_STMT(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
+ 
+ /* Returns the SSA version number of this SSA name.  Note that in
+    tree SSA, version numbers are not per-variable.  */
  #define SSA_NAME_VERSION(NODE)	SSA_NAME_CHECK (NODE)->ssa_name.version
+ 
+ /* Nonzero if this SSA name occurs in an abnormal PHI.  We can safely use
+    a lang_flag here since we can be sure that SSA names never appear as
+    language specific nodes.  */
  #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
!     TREE_LANG_FLAG_6 (SSA_NAME_CHECK (NODE))
  
  struct tree_ssa_name GTY(())
  {
    struct tree_common common;
  
    /* _DECL wrapped by this SSA name.  */
    tree var;
  
*************** struct tree_ssa_name GTY(())
*** 1031,1047 ****
  };
  
  /* In a PHI_NODE node.  */
  #define PHI_RESULT(NODE)	PHI_NODE_CHECK (NODE)->phi.result
  
! /* Nonzero if the PHI node was rewritten by a previous pass through the
!    SSA renamer.  */
! #define PHI_REWRITTEN(NODE)	PHI_NODE_CHECK (NODE)->phi.rewritten
  #define PHI_NUM_ARGS(NODE)	PHI_NODE_CHECK (NODE)->phi.num_args
  #define PHI_ARG_CAPACITY(NODE)	PHI_NODE_CHECK (NODE)->phi.capacity
  #define PHI_ARG_ELT(NODE, I)	PHI_NODE_ELT_CHECK (NODE, I)
  #define PHI_ARG_EDGE(NODE, I)	PHI_NODE_ELT_CHECK (NODE, I).e
  #define PHI_ARG_DEF(NODE, I)	PHI_NODE_ELT_CHECK (NODE, I).def
  
  struct edge_def;
  
  struct phi_arg_d GTY(())
--- 1037,1061 ----
  };
  
  /* In a PHI_NODE node.  */
+ 
+ /* The right hand side of the PHI expression.  */
  #define PHI_RESULT(NODE)	PHI_NODE_CHECK (NODE)->phi.result
  
! /* The number of arguments to this PHI node.  */
  #define PHI_NUM_ARGS(NODE)	PHI_NODE_CHECK (NODE)->phi.num_args
+ 
+ /* The maximum number of arguments this PHI can take.  */
  #define PHI_ARG_CAPACITY(NODE)	PHI_NODE_CHECK (NODE)->phi.capacity
+ 
+ /* Accessors to PHI arguments.  */
  #define PHI_ARG_ELT(NODE, I)	PHI_NODE_ELT_CHECK (NODE, I)
  #define PHI_ARG_EDGE(NODE, I)	PHI_NODE_ELT_CHECK (NODE, I).e
  #define PHI_ARG_DEF(NODE, I)	PHI_NODE_ELT_CHECK (NODE, I).def
  
+ /* Nonzero if the PHI node was rewritten by a previous pass through the
+    SSA renamer.  */
+ #define PHI_REWRITTEN(NODE)	TREE_LANG_FLAG_6 (PHI_NODE_CHECK (NODE))
+ 
  struct edge_def;
  
  struct phi_arg_d GTY(())
*************** struct tree_phi_node GTY(())
*** 1056,1066 ****
    tree result;
    int num_args;
    int capacity;
- 
-   /* Nonzero if the PHI node was rewritten by a previous pass through the
-      SSA renamer.  */
-   int rewritten;
- 
    struct phi_arg_d GTY ((length ("((tree)&%h)->phi.capacity"))) a[1];
  };
  
--- 1070,1075 ----

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