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] Fix SSA stats output [patch]


We weren't dumping information about VDEFs and VUSEs in the SSA stats
output.

The patch also adds code to show when VDEFs get converted into
real copies.

Tested on x86.


Diego.



	* tree-dfa.c (struct dfa_stats_d): Remove obsolete fields
	num_tree_refs and size_tree_refs.  Update all users.
	(dump_dfa_stats): Also dump information about VUSE and VDEF
	operands.
	* tree-ssa.c (rewrite_vdefs): Dump information about VDEF operators
	promoted to real copies if -fdump-tree-optimized-details is given.

Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.122
diff -d -c -p -r1.1.4.122 tree-dfa.c
*** tree-dfa.c	24 Jun 2003 02:13:57 -0000	1.1.4.122
--- tree-dfa.c	24 Jun 2003 22:31:58 -0000
*************** Boston, MA 02111-1307, USA.  */
*** 49,56 ****
  /* Counters used to display DFA and SSA statistics.  */
  struct dfa_stats_d
  {
-   long num_tree_refs;
-   long size_tree_refs;
    long num_stmt_anns;
    long num_var_anns;
    long num_defs;
--- 49,54 ----
*************** dump_dfa_stats (FILE *file)
*** 1331,1336 ****
--- 1329,1344 ----
    fprintf (file, fmt_str_1, "DEF operands", dfa_stats.num_defs,
  	   SCALE (size), LABEL (size));
  
+   size = dfa_stats.num_vuses * sizeof (tree *);
+   total += size;
+   fprintf (file, fmt_str_1, "VUSE operands", dfa_stats.num_vuses,
+ 	   SCALE (size), LABEL (size));
+ 
+   size = dfa_stats.num_vdefs * sizeof (tree *);
+   total += size;
+   fprintf (file, fmt_str_1, "VDEF operands", dfa_stats.num_vdefs,
+ 	   SCALE (size), LABEL (size));
+ 
    size = dfa_stats.num_phis * sizeof (struct tree_phi_node);
    total += size;
    fprintf (file, fmt_str_1, "PHI nodes", dfa_stats.num_phis,
*************** dump_dfa_stats (FILE *file)
*** 1340,1350 ****
    total += size;
    fprintf (file, fmt_str_1, "PHI arguments", dfa_stats.num_phi_args,
   	   SCALE (size), LABEL (size));
- 
-   size = dfa_stats.size_tree_refs;
-   total += size;
-   fprintf (file, fmt_str_1, "Virtual references", dfa_stats.num_tree_refs,
- 	   SCALE (size), LABEL (size));
  
    fprintf (file, "---------------------------------------------------------\n");
    fprintf (file, fmt_str_3, "Total memory used by DFA/SSA data", SCALE (total),
--- 1348,1353 ----
Index: tree-ssa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa.c,v
retrieving revision 1.1.4.95
diff -d -c -p -r1.1.4.95 tree-ssa.c
*** tree-ssa.c	24 Jun 2003 02:13:58 -0000	1.1.4.95
--- tree-ssa.c	24 Jun 2003 22:31:58 -0000
*************** rewrite_vdefs (block_stmt_iterator *si_p
*** 1738,1743 ****
--- 1738,1751 ----
  	{
  	  tree t = build (MODIFY_EXPR, TREE_TYPE (lhs), lhs, rhs);
  	  bsi_insert_before (si_p, t, BSI_SAME_STMT);
+ 	  if (tree_ssa_dump_file && (tree_ssa_dump_flags & TDF_DETAILS))
+ 	    {
+ 	      fprintf (tree_ssa_dump_file, "Promoting VDEF ");
+ 	      print_generic_stmt (tree_ssa_dump_file, vdef, 0);
+ 	      fprintf (tree_ssa_dump_file, "into the real assignment ");
+ 	      print_generic_stmt (tree_ssa_dump_file, t, 0);
+ 	      fprintf (tree_ssa_dump_file, "\n");
+ 	    }
  	}
      }
  }


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