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] Turn non-detailed dumping verbosity of estimate_function_body_sizes


On Tue, Sep 15, 2009 at 01:55:22PM +0200, Richard Guenther wrote:
> On Tue, Sep 15, 2009 at 1:39 PM, Martin Jambor <mjambor@suse.cz> wrote:
> > Hi,
> >
> > estimate_function_body_sizes() in ipa-inline.c dumps info about every
> > statement in the function even when not dumping details. ÂSo I
> > suppressed this when TDF_DETAILS is not set. ÂI also used this
> > opportunity to re-format the function since it is currently casually
> > exceeding 80 characters per line even when it was not necessary at all
> > and has some other minor formatting issues. ÂI have not changed the
> > functionality at all.
> >
> > Bootstrapped and tested on x86_64-linux. ÂOK for trunk?
> 
> Ok.
> 
> Thanks,
> Richard.
> 

The eh overhaul deleted the big comment my patch was reformatting,
thus I committed this after re-testing.

Thanks,

Martin

2009-09-15  Martin Jambor  <mjambor@suse.cz>

	* ipa-inline.c (estimate_function_body_sizes): Dump info about
	individual statements only at TDF_DETAILS dump level.  Format
	source for 80 characters per line.


Index: small/gcc/ipa-inline.c
===================================================================
--- small.orig/gcc/ipa-inline.c
+++ small/gcc/ipa-inline.c
@@ -1737,9 +1737,8 @@ estimate_function_body_sizes (struct cgr
   tree funtype = TREE_TYPE (node->decl);
 
   if (dump_file)
-    {
-      fprintf (dump_file, "Analyzing function body size: %s\n", cgraph_node_name (node));
-    }
+    fprintf (dump_file, "Analyzing function body size: %s\n",
+	     cgraph_node_name (node));
 
   gcc_assert (my_function && my_function->cfg);
   FOR_EACH_BB_FN (bb, my_function)
@@ -1751,7 +1750,7 @@ estimate_function_body_sizes (struct cgr
 	  int this_size = estimate_num_insns (stmt, &eni_size_weights);
 	  int this_time = estimate_num_insns (stmt, &eni_time_weights);
 
-	  if (dump_file)
+	  if (dump_file && (dump_flags & TDF_DETAILS))
 	    {
 	      fprintf (dump_file, "  freq:%6i size:%3i time:%3i ",
 		       freq, this_size, this_time);
@@ -1764,7 +1763,7 @@ estimate_function_body_sizes (struct cgr
 	    {
 	      size_inlining_benefit += this_size;
 	      time_inlining_benefit += this_time;
-	      if (dump_file)
+	      if (dump_file && (dump_flags & TDF_DETAILS))
 		fprintf (dump_file, "    Likely eliminated\n");
 	    }
 	  gcc_assert (time >= 0);
@@ -1775,11 +1774,9 @@ estimate_function_body_sizes (struct cgr
   time_inlining_benefit = ((time_inlining_benefit + CGRAPH_FREQ_BASE / 2)
   			   / CGRAPH_FREQ_BASE);
   if (dump_file)
-    {
-      fprintf (dump_file, "Overall function body time: %i-%i size: %i-%i\n",
-               (int)time, (int)time_inlining_benefit,
-      	       size, size_inlining_benefit);
-    }
+    fprintf (dump_file, "Overall function body time: %i-%i size: %i-%i\n",
+	     (int)time, (int)time_inlining_benefit,
+	     size, size_inlining_benefit);
   time_inlining_benefit += eni_time_weights.call_cost;
   size_inlining_benefit += eni_size_weights.call_cost;
   if (!VOID_TYPE_P (TREE_TYPE (funtype)))
@@ -1802,11 +1799,9 @@ estimate_function_body_sizes (struct cgr
   inline_summary (node)->self_time = time;
   inline_summary (node)->self_size = size;
   if (dump_file)
-    {
-      fprintf (dump_file, "With function call overhead time: %i-%i size: %i-%i\n",
-               (int)time, (int)time_inlining_benefit,
-      	       size, size_inlining_benefit);
-    }
+    fprintf (dump_file, "With function call overhead time: %i-%i size: %i-%i\n",
+	     (int)time, (int)time_inlining_benefit,
+	     size, size_inlining_benefit);
   inline_summary (node)->time_inlining_benefit = time_inlining_benefit;
   inline_summary (node)->size_inlining_benefit = size_inlining_benefit;
 }



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