[PATCH] Use less vertical spacing in data-ref analysis dumps

Richard Biener rguenther@suse.de
Thu Jan 3 16:37:00 GMT 2013


This halves the size of vect dumps for mgrid with -details.  The
dataref analysis parts have too much spacing.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2013-01-03  Richard Biener  <rguenther@suse.de>

	* tree-data-ref.c (dump_conflict_function): Use less vertical
	spacing.
	(dump_subscript): Adjust.
	(finalize_ddr_dependent): Do not dump redundant info.
	(analyze_siv_subscript): Adjust.
	(subscript_dependence_tester): Likewise.
	(compute_affine_dependence): Likewise.

Index: gcc/tree-data-ref.c
===================================================================
*** gcc/tree-data-ref.c	(revision 194844)
--- gcc/tree-data-ref.c	(working copy)
*************** dump_conflict_function (FILE *outf, conf
*** 216,231 ****
    unsigned i;
  
    if (cf->n == NO_DEPENDENCE)
!     fprintf (outf, "no dependence\n");
    else if (cf->n == NOT_KNOWN)
!     fprintf (outf, "not known\n");
    else
      {
        for (i = 0; i < cf->n; i++)
  	{
  	  fprintf (outf, "[");
  	  dump_affine_function (outf, cf->fns[i]);
! 	  fprintf (outf, "]\n");
  	}
      }
  }
--- 216,233 ----
    unsigned i;
  
    if (cf->n == NO_DEPENDENCE)
!     fprintf (outf, "no dependence");
    else if (cf->n == NOT_KNOWN)
!     fprintf (outf, "not known");
    else
      {
        for (i = 0; i < cf->n; i++)
  	{
+ 	  if (i != 0)
+ 	    fprintf (outf, " ");
  	  fprintf (outf, "[");
  	  dump_affine_function (outf, cf->fns[i]);
! 	  fprintf (outf, "]");
  	}
      }
  }
*************** dump_subscript (FILE *outf, struct subsc
*** 243,266 ****
    if (CF_NONTRIVIAL_P (cf))
      {
        tree last_iteration = SUB_LAST_CONFLICT (subscript);
!       fprintf (outf, "  last_conflict: ");
!       print_generic_stmt (outf, last_iteration, 0);
      }
  
    cf = SUB_CONFLICTS_IN_B (subscript);
!   fprintf (outf, "  iterations_that_access_an_element_twice_in_B: ");
    dump_conflict_function (outf, cf);
    if (CF_NONTRIVIAL_P (cf))
      {
        tree last_iteration = SUB_LAST_CONFLICT (subscript);
!       fprintf (outf, "  last_conflict: ");
!       print_generic_stmt (outf, last_iteration, 0);
      }
  
!   fprintf (outf, "  (Subscript distance: ");
!   print_generic_stmt (outf, SUB_DISTANCE (subscript), 0);
!   fprintf (outf, "  )\n");
!   fprintf (outf, " )\n");
  }
  
  /* Print the classic direction vector DIRV to OUTF.  */
--- 245,267 ----
    if (CF_NONTRIVIAL_P (cf))
      {
        tree last_iteration = SUB_LAST_CONFLICT (subscript);
!       fprintf (outf, "\n  last_conflict: ");
!       print_generic_expr (outf, last_iteration, 0);
      }
  
    cf = SUB_CONFLICTS_IN_B (subscript);
!   fprintf (outf, "\n  iterations_that_access_an_element_twice_in_B: ");
    dump_conflict_function (outf, cf);
    if (CF_NONTRIVIAL_P (cf))
      {
        tree last_iteration = SUB_LAST_CONFLICT (subscript);
!       fprintf (outf, "\n  last_conflict: ");
!       print_generic_expr (outf, last_iteration, 0);
      }
  
!   fprintf (outf, "\n  (Subscript distance: ");
!   print_generic_expr (outf, SUB_DISTANCE (subscript), 0);
!   fprintf (outf, " ))\n");
  }
  
  /* Print the classic direction vector DIRV to OUTF.  */
*************** static inline void
*** 1507,1519 ****
  finalize_ddr_dependent (struct data_dependence_relation *ddr,
  			tree chrec)
  {
-   if (dump_file && (dump_flags & TDF_DETAILS))
-     {
-       fprintf (dump_file, "(dependence classified: ");
-       print_generic_expr (dump_file, chrec, 0);
-       fprintf (dump_file, ")\n");
-     }
- 
    DDR_ARE_DEPENDENT (ddr) = chrec;
    free_subscripts (DDR_SUBSCRIPTS (ddr));
    DDR_SUBSCRIPTS (ddr).create (0);
--- 1508,1513 ----
*************** end_analyze_subs_aa:
*** 2647,2654 ****
        dump_conflict_function (dump_file, *overlaps_a);
        fprintf (dump_file, ")\n  (overlaps_b = ");
        dump_conflict_function (dump_file, *overlaps_b);
!       fprintf (dump_file, ")\n");
!       fprintf (dump_file, ")\n");
      }
  }
  
--- 2641,2647 ----
        dump_conflict_function (dump_file, *overlaps_a);
        fprintf (dump_file, ")\n  (overlaps_b = ");
        dump_conflict_function (dump_file, *overlaps_b);
!       fprintf (dump_file, "))\n");
      }
  }
  
*************** analyze_siv_subscript (tree chrec_a,
*** 2769,2775 ****
      {
      siv_subscript_dontknow:;
        if (dump_file && (dump_flags & TDF_DETAILS))
! 	fprintf (dump_file, "siv test failed: unimplemented.\n");
        *overlaps_a = conflict_fn_not_known ();
        *overlaps_b = conflict_fn_not_known ();
        *last_conflicts = chrec_dont_know;
--- 2762,2768 ----
      {
      siv_subscript_dontknow:;
        if (dump_file && (dump_flags & TDF_DETAILS))
! 	fprintf (dump_file, "  siv test failed: unimplemented");
        *overlaps_a = conflict_fn_not_known ();
        *overlaps_b = conflict_fn_not_known ();
        *last_conflicts = chrec_dont_know;
*************** analyze_overlapping_iterations (tree chr
*** 2994,3001 ****
        dump_conflict_function (dump_file, *overlap_iterations_a);
        fprintf (dump_file, ")\n  (overlap_iterations_b = ");
        dump_conflict_function (dump_file, *overlap_iterations_b);
!       fprintf (dump_file, ")\n");
!       fprintf (dump_file, ")\n");
      }
  }
  
--- 2987,2993 ----
        dump_conflict_function (dump_file, *overlap_iterations_a);
        fprintf (dump_file, ")\n  (overlap_iterations_b = ");
        dump_conflict_function (dump_file, *overlap_iterations_b);
!       fprintf (dump_file, "))\n");
      }
  }
  
*************** static void
*** 3554,3572 ****
  subscript_dependence_tester (struct data_dependence_relation *ddr,
  			     struct loop *loop_nest)
  {
- 
-   if (dump_file && (dump_flags & TDF_DETAILS))
-     fprintf (dump_file, "(subscript_dependence_tester \n");
- 
    if (subscript_dependence_tester_1 (ddr, DDR_A (ddr), DDR_B (ddr), loop_nest))
      dependence_stats.num_dependence_dependent++;
  
    compute_subscript_distance (ddr);
    if (build_classic_dist_vector (ddr, loop_nest))
      build_classic_dir_vector (ddr);
- 
-   if (dump_file && (dump_flags & TDF_DETAILS))
-     fprintf (dump_file, ")\n");
  }
  
  /* Returns true when all the access functions of A are affine or
--- 3546,3557 ----
*************** compute_affine_dependence (struct data_d
*** 4146,4156 ****
        if (access_functions_are_affine_or_constant_p (dra, loop_nest)
  	  && access_functions_are_affine_or_constant_p (drb, loop_nest))
  	{
  	  if (flag_check_data_deps)
  	    {
! 	      /* Compute the dependences using the first algorithm.  */
! 	      subscript_dependence_tester (ddr, loop_nest);
! 
  	      if (dump_file && (dump_flags & TDF_DETAILS))
  		{
  		  fprintf (dump_file, "\n\nBanerjee Analyzer\n");
--- 4131,4141 ----
        if (access_functions_are_affine_or_constant_p (dra, loop_nest)
  	  && access_functions_are_affine_or_constant_p (drb, loop_nest))
  	{
+ 	  subscript_dependence_tester (ddr, loop_nest);
+ 
  	  if (flag_check_data_deps)
  	    {
! 	      /* Dump the dependences from the first algorithm.  */
  	      if (dump_file && (dump_flags & TDF_DETAILS))
  		{
  		  fprintf (dump_file, "\n\nBanerjee Analyzer\n");
*************** compute_affine_dependence (struct data_d
*** 4186,4193 ****
  						  dir_vects));
  		}
  	    }
- 	  else
- 	    subscript_dependence_tester (ddr, loop_nest);
  	}
  
        /* As a last case, if the dependence cannot be determined, or if
--- 4171,4176 ----



More information about the Gcc-patches mailing list