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]

[vta,vta4.4] Re: VTA merge - cmdline


On Jun  5, 2009, Alexandre Oliva <aoliva@redhat.com> wrote:

> On Jun  5, 2009, Richard Guenther <richard.guenther@gmail.com> wrote:
>> -fverbose-cselib should be split out completely I guess.
>> And why does it not use -fdump-rtl-var-tracking-details and the
>> dump_flags machinery?

> Another more important reason is that the idea of using such details
> flags never occurred to me.  I just got the idea of a verbose flag like
> this from -fsched-verbose, and it seemed just fine to me.

Here's a patch for VTA and VTA4.4 branches that drops -fverbose-cselib
altogether and uses TDF_DETAILS instead.  Thanks for the suggestion.

for  gcc/ChangeLog.vta
from   Alexandre Oliva  <aoliva@redhat.com>

	* common.opt (fverbose-cselib): Drop.
	* doc/invoke.texi: Likewise.
	* Makefile.in (cselib.o): Depend on $(TREE_PASS_H).
	* cselib.c: Include tree-pass.h.  Use TDF_DETAILS from dump_flags
	instead of flag_verbose_cselib.
	* var-tracking.c: Likewise.
	
Index: gcc/common.opt
===================================================================
--- gcc/common.opt.orig	2009-06-11 06:21:41.000000000 -0300
+++ gcc/common.opt	2009-06-11 06:42:52.000000000 -0300
@@ -1380,10 +1380,6 @@ fverbose-asm
 Common Report Var(flag_verbose_asm)
 Add extra commentary to assembler output
 
-fverbose-cselib
-Common Var(flag_verbose_cselib)
-Add a lot of information to dumps of passes that use cselib.
-
 fvisibility=
 Common Joined RejectNegative
 -fvisibility=[default|internal|hidden|protected]	Set the default symbol visibility
Index: gcc/cselib.c
===================================================================
--- gcc/cselib.c.orig	2009-06-11 06:21:41.000000000 -0300
+++ gcc/cselib.c	2009-06-11 06:42:52.000000000 -0300
@@ -38,6 +38,7 @@ along with GCC; see the file COPYING3.  
 #include "output.h"
 #include "ggc.h"
 #include "hashtab.h"
+#include "tree-pass.h"
 #include "cselib.h"
 #include "params.h"
 #include "alloc-pool.h"
@@ -867,7 +868,7 @@ new_cselib_val (unsigned int value, enum
   e->locs = 0;
   e->next_containing_mem = 0;
 
-  if (dump_file && flag_verbose_cselib)
+  if (dump_file && (dump_flags & TDF_DETAILS))
     {
       fprintf (dump_file, "cselib value %u ", value);
       if (flag_dump_noaddr || flag_dump_unnumbered)
@@ -978,7 +979,7 @@ expand_loc (struct elt_loc_list *p, stru
       else if (!REG_P (p->loc))
 	{
 	  rtx result, note;
-	  if (dump_file && flag_verbose_cselib)
+	  if (dump_file && (dump_flags & TDF_DETAILS))
 	    {
 	      print_inline_rtx (dump_file, p->loc, 0);
 	      fprintf (dump_file, "\n");
@@ -999,7 +1000,7 @@ expand_loc (struct elt_loc_list *p, stru
   if (regno != UINT_MAX)
     {
       rtx result;
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	fprintf (dump_file, "r%d\n", regno);
 
       result = cselib_expand_value_rtx_1 (reg_result, evd, max_depth - 1);
@@ -1007,7 +1008,7 @@ expand_loc (struct elt_loc_list *p, stru
 	return result;
     }
 
-  if (dump_file && flag_verbose_cselib)
+  if (dump_file && (dump_flags & TDF_DETAILS))
     {
       if (reg_result)
 	{
@@ -1028,7 +1029,7 @@ check_wrap_constant (enum machine_mode m
   if (!result || GET_MODE (result) == mode)
     return result;
 
-  if (dump_file && flag_verbose_cselib)
+  if (dump_file && (dump_flags & TDF_DETAILS))
     fprintf (dump_file, "  wrapping result in const to preserve mode %s\n",
 	     GET_MODE_NAME (mode));
 
@@ -1143,7 +1144,7 @@ cselib_expand_value_rtx_1 (rtx orig, str
 
 	      bitmap_set_bit (evd->regs_active, regno);
 
-	      if (dump_file && flag_verbose_cselib)
+	      if (dump_file && (dump_flags & TDF_DETAILS))
 		fprintf (dump_file, "expanding: r%d into: ", regno);
 
 	      result = expand_loc (l->elt->locs, evd, max_depth);
@@ -1198,7 +1199,7 @@ cselib_expand_value_rtx_1 (rtx orig, str
     case VALUE:
       {
 	rtx result;
-	if (dump_file && flag_verbose_cselib)
+	if (dump_file && (dump_flags & TDF_DETAILS))
 	  {
 	    fputs ("\nexpanding ", dump_file);
 	    print_rtl_single (dump_file, orig);
@@ -1339,7 +1340,7 @@ cselib_expand_value_rtx_1 (rtx orig, str
     {
       XEXP (copy, 0)
 	= gen_rtx_CONST (GET_MODE (XEXP (orig, 0)), XEXP (copy, 0));
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	fprintf (dump_file, "  wrapping const_int result in const to preserve mode %s\n",
 		 GET_MODE_NAME (GET_MODE (XEXP (copy, 0))));
     }
@@ -1452,7 +1453,7 @@ cselib_subst_to_values (rtx x)
 static cselib_val *
 cselib_log_lookup (rtx x, cselib_val *ret)
 {
-  if (dump_file && flag_verbose_cselib)
+  if (dump_file && (dump_flags & TDF_DETAILS))
     {
       fputs ("cselib lookup ", dump_file);
       print_inline_rtx (dump_file, x, 2);
Index: gcc/var-tracking.c
===================================================================
--- gcc/var-tracking.c.orig	2009-06-11 06:42:52.000000000 -0300
+++ gcc/var-tracking.c	2009-06-11 06:42:52.000000000 -0300
@@ -1421,7 +1421,7 @@ val_resolve (dataflow_set *set, rtx val,
 {
   decl_or_value dv = dv_from_value (val);
 
-  if (dump_file && flag_verbose_cselib)
+  if (dump_file && (dump_flags & TDF_DETAILS))
     {
       if (insn)
 	fprintf (dump_file, "%i: ", INSN_UID (insn));
@@ -3571,7 +3571,7 @@ dataflow_set_different_1 (void **slot, v
     {
       dataflow_set_different_value = true;
 
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	{
 	  fprintf (dump_file, "dataflow difference found: removal of:\n");
 	  dump_variable (var1);
@@ -3585,7 +3585,7 @@ dataflow_set_different_1 (void **slot, v
     {
       dataflow_set_different_value = true;
 
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	{
 	  fprintf (dump_file, "dataflow difference found: old and new follow:\n");
 	  dump_variable (var1);
@@ -3616,7 +3616,7 @@ dataflow_set_different_2 (void **slot, v
     {
       dataflow_set_different_value = true;
 
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	{
 	  fprintf (dump_file, "dataflow difference found: addition of:\n");
 	  dump_variable (var1);
@@ -4069,7 +4069,7 @@ count_uses (rtx *loc, void *cuip)
 
       VTI (cui->bb)->n_mos++;
 
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	log_op_type (*loc, cui->bb, cui->insn, mopt, dump_file);
 
       switch (mopt)
@@ -4217,7 +4217,7 @@ add_uses (rtx *loc, void *data)
 		  mo->type = MO_VAL_USE;
 		  mloc = cselib_subst_to_values (XEXP (mloc, 0));
 		  mo->u.loc = gen_rtx_CONCAT (Pmode, val->val_rtx, mloc);
-		  if (dump_file && flag_verbose_cselib)
+		  if (dump_file && (dump_flags & TDF_DETAILS))
 		    log_op_type (mo->u.loc, cui->bb, cui->insn,
 				 mo->type, dump_file);
 		  mo = mon;
@@ -4285,7 +4285,7 @@ add_uses (rtx *loc, void *data)
 		  mloc = cselib_subst_to_values (XEXP (mloc, 0));
 		  mo->u.loc = gen_rtx_CONCAT (Pmode, val->val_rtx, mloc);
 		  mo->insn = cui->insn;
-		  if (dump_file && flag_verbose_cselib)
+		  if (dump_file && (dump_flags & TDF_DETAILS))
 		    log_op_type (mo->u.loc, cui->bb, cui->insn,
 				 mo->type, dump_file);
 		  mo = mon;
@@ -4334,7 +4334,7 @@ add_uses (rtx *loc, void *data)
       else
 	gcc_assert (type == MO_USE || type == MO_USE_NO_VAR);
 
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	log_op_type (mo->u.loc, cui->bb, cui->insn, mo->type, dump_file);
     }
 
@@ -4425,7 +4425,7 @@ add_stores (rtx loc, const_rtx expr, voi
 	      mloc = cselib_subst_to_values (XEXP (mloc, 0));
 	      mo->u.loc = gen_rtx_CONCAT (Pmode, val->val_rtx, mloc);
 	      mo->insn = cui->insn;
-	      if (dump_file && flag_verbose_cselib)
+	      if (dump_file && (dump_flags & TDF_DETAILS))
 		log_op_type (mo->u.loc, cui->bb, cui->insn,
 			     mo->type, dump_file);
 	      mo = VTI (bb)->mos + VTI (bb)->n_mos++;
@@ -4543,7 +4543,7 @@ add_stores (rtx loc, const_rtx expr, voi
   mo->type = MO_VAL_SET;
 
  log_and_return:
-  if (dump_file && flag_verbose_cselib)
+  if (dump_file && (dump_flags & TDF_DETAILS))
     log_op_type (mo->u.loc, cui->bb, cui->insn, mo->type, dump_file);
 }
 
@@ -4598,7 +4598,7 @@ add_with_sets (rtx insn, struct cselib_s
       mo->type = MO_CALL;
       mo->insn = insn;
 
-      if (dump_file && flag_verbose_cselib)
+      if (dump_file && (dump_flags & TDF_DETAILS))
 	log_op_type (PATTERN (insn), bb, insn, mo->type, dump_file);
     }
 
@@ -5045,7 +5045,7 @@ vt_find_locations (void)
 		  /* Calculate the IN set as the intersection of
 		     predecessor OUT sets.  */
 
-		  if (flag_verbose_cselib)
+		  if ((dump_flags & TDF_DETAILS))
 		    {
 		      oldinp = &oin;
 		      *oldinp = *in;
@@ -5086,7 +5086,7 @@ vt_find_locations (void)
 
 		  VTI (bb)->flooded = true;
 
-		  if (oldinp && dump_file && flag_verbose_cselib
+		  if (oldinp && dump_file && (dump_flags & TDF_DETAILS)
 		      && dataflow_set_different (oldinp, in))
 		    {
 		      fprintf (dump_file,
@@ -5155,7 +5155,7 @@ vt_find_locations (void)
 			 (int)VTI (bb)->out.vars->n_elements, oldoutsz,
 			 (int)worklist->nodes, (int)pending->nodes, htabsz);
 
-	      if (dump_file && flag_verbose_cselib)
+	      if (dump_file && (dump_flags & TDF_DETAILS))
 		{
 		  fprintf (dump_file, "BB %i IN:\n", bb->index);
 		  dump_dataflow_set (&VTI (bb)->in);
@@ -6614,7 +6614,7 @@ vt_initialize (void)
       if (MAY_HAVE_DEBUG_INSNS)
 	{
 	  cselib_record_sets_hook = count_with_sets;
-	  if (dump_file && flag_verbose_cselib)
+	  if (dump_file && (dump_flags & TDF_DETAILS))
 	    fprintf (dump_file, "first value: %i\n",
 		     cselib_get_next_unknown_value ());
 	}
@@ -6632,14 +6632,14 @@ vt_initialize (void)
 		  if (pre)
 		    {
 		      VTI (bb)->n_mos++;
-		      if (dump_file && flag_verbose_cselib)
+		      if (dump_file && (dump_flags & TDF_DETAILS))
 			log_op_type (GEN_INT (pre), bb, insn,
 				     MO_ADJUST, dump_file);
 		    }
 		  if (post)
 		    {
 		      VTI (bb)->n_mos++;
-		      if (dump_file && flag_verbose_cselib)
+		      if (dump_file && (dump_flags & TDF_DETAILS))
 			log_op_type (GEN_INT (post), bb, insn,
 				     MO_ADJUST, dump_file);
 		    }
@@ -6648,7 +6648,7 @@ vt_initialize (void)
 	      if (MAY_HAVE_DEBUG_INSNS)
 		{
 		  cselib_process_insn (insn);
-		  if (dump_file && flag_verbose_cselib)
+		  if (dump_file && (dump_flags & TDF_DETAILS))
 		    {
 		      print_rtl_single (dump_file, insn);
 		      dump_cselib_table (dump_file);
@@ -6659,7 +6659,7 @@ vt_initialize (void)
 	      if (CALL_P (insn))
 		{
 		  VTI (bb)->n_mos++;
-		  if (dump_file && flag_verbose_cselib)
+		  if (dump_file && (dump_flags & TDF_DETAILS))
 		    log_op_type (PATTERN (insn), bb, insn,
 				 MO_CALL, dump_file);
 		}
@@ -6674,7 +6674,7 @@ vt_initialize (void)
 	  next_value_after = cselib_get_next_unknown_value ();
 	  cselib_reset_table_with_next_value (next_value_before);
 	  cselib_record_sets_hook = add_with_sets;
-	  if (dump_file && flag_verbose_cselib)
+	  if (dump_file && (dump_flags & TDF_DETAILS))
 	    fprintf (dump_file, "first value: %i\n",
 		     cselib_get_next_unknown_value ());
 	}
@@ -6698,7 +6698,7 @@ vt_initialize (void)
 		      mo->u.adjust = pre;
 		      mo->insn = insn;
 
-		      if (dump_file && flag_verbose_cselib)
+		      if (dump_file && (dump_flags & TDF_DETAILS))
 			log_op_type (PATTERN (insn), bb, insn,
 				     MO_ADJUST, dump_file);
 		    }
@@ -6708,7 +6708,7 @@ vt_initialize (void)
 	      if (MAY_HAVE_DEBUG_INSNS)
 		{
 		  cselib_process_insn (insn);
-		  if (dump_file && flag_verbose_cselib)
+		  if (dump_file && (dump_flags & TDF_DETAILS))
 		    {
 		      print_rtl_single (dump_file, insn);
 		      dump_cselib_table (dump_file);
@@ -6725,7 +6725,7 @@ vt_initialize (void)
 		  mo->u.adjust = post;
 		  mo->insn = insn;
 
-		  if (dump_file && flag_verbose_cselib)
+		  if (dump_file && (dump_flags & TDF_DETAILS))
 		    log_op_type (PATTERN (insn), bb, insn,
 				 MO_ADJUST, dump_file);
 		}
Index: gcc/Makefile.in
===================================================================
--- gcc/Makefile.in.orig	2009-06-11 06:21:41.000000000 -0300
+++ gcc/Makefile.in	2009-06-11 06:42:52.000000000 -0300
@@ -2678,8 +2678,9 @@ coverage.o : coverage.c $(GCOV_IO_H) $(C
    $(HASHTAB_H) tree-iterator.h $(CGRAPH_H) $(TREE_PASS_H) gcov-io.c $(TM_P_H)
 cselib.o : cselib.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(REGS_H) hard-reg-set.h $(FLAGS_H) $(REAL_H) insn-config.h $(RECOG_H) \
-   $(EMIT_RTL_H) $(TOPLEV_H) output.h $(FUNCTION_H) cselib.h $(GGC_H) $(TM_P_H) \
-   gt-cselib.h $(PARAMS_H) alloc-pool.h $(HASHTAB_H) $(TARGET_H)
+   $(EMIT_RTL_H) $(TOPLEV_H) output.h $(FUNCTION_H) $(TREE_PASS_H) \
+   cselib.h gt-cselib.h $(GGC_H) $(TM_P_H) $(PARAMS_H) alloc-pool.h \
+   $(HASHTAB_H) $(TARGET_H)
 cse.o : cse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
    hard-reg-set.h $(FLAGS_H) insn-config.h $(RECOG_H) $(EXPR_H) $(TOPLEV_H) \
    output.h $(FUNCTION_H) $(BASIC_BLOCK_H) $(GGC_H) $(TM_P_H) $(TIMEVAR_H) \
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi.orig	2009-06-11 06:52:50.000000000 -0300
+++ gcc/doc/invoke.texi	2009-06-11 06:53:27.000000000 -0300
@@ -310,7 +310,7 @@ Objective-C and Objective-C++ Dialects}.
 -fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
 -ftest-coverage  -ftime-report -fvar-tracking @gol
 -fvar-tracking-assigments  -fvar-tracking-assignments-toggle @gol
--fverbose-cselib  -g  -g@var{level}  -gtoggle @gol
+-g  -g@var{level}  -gtoggle @gol
 -gcoff  -gdwarf-2 -ggdb  -gstabs  -gstabs+  -gvms  -gxcoff  -gxcoff+ @gol
 -fno-merge-debug-strings -fno-dwarf2-cfi-asm @gol
 -fdebug-prefix-map=@var{old}=@var{new} @gol
@@ -5394,11 +5394,6 @@ annotations will be created and maintain
 Toggle @option{-fvar-tracking-assignments}, in the same way that
 @option{-gtoggle} toggles @option{-g}.
 
-@item -fverbose-cselib
-@opindex fverbose-cselib
-Cause cselib to add a lot of information to the dump files of passes
-that use it, if dumping is enabled on such passes.
-
 @item -print-file-name=@var{library}
 @opindex print-file-name
 Print the full absolute name of the library file @var{library} that
-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

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