[killloop] Restrict scev/data dependence dumps

Zdenek Dvorak rakdver@atrey.karlin.mff.cuni.cz
Thu Sep 15 08:19:00 GMT 2005


Hello,

on-demand scev and data dependence analyses produce quite rich dumps
with -fdump-tree-details.  These dumps tend to get interlaced with
the dumps of the pass that uses the analysis, making it harder to read.
Additionally, unless something gets wrong in these analyses (which
usually is not the case, since they are quite well tested now),
these dumps are not really interesting.  This pass adds new dump
level -fdump-tree-analysis, at which scev and data dependence still
produce the dumps, and omits the dumps at -fdump-tree-details.

Zdenek

	* tree-data-ref.c (analyze_array, analyze_indirect_ref, init_data_ref,
	analyze_offset_expr, address_analysis, object_analysis,
	create_data_ref, finalize_ddr_dependent, analyze_ziv_subscript,
	analyze_subscript_affine_affine, analyze_siv_subscript,
	analyze_miv_subscript, analyze_overlapping_iterations,
	subscript_dependence_tester, compute_affine_dependence,
	analyze_all_data_dependences): Dump only with TDF_ANALYSIS.
	* tree-scalar-evolution.c (set_scalar_evolution, get_scalar_evolution,
	add_to_evolution, set_nb_iterations_in_loop, get_loop_exit_condition,
	analyze_evolution_in_loop, analyze_initial_condition,
	analyze_scalar_evolution, instantiate_parameters,
	number_of_iterations_in_loop): Ditto.
	* tree-dump.c (dump_options): Add TDF_ANALYSIS.
	* tree-pass.h (enum tdf): New.  Add TDF_ANALYSIS.

Index: tree-data-ref.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-data-ref.c,v
retrieving revision 2.35.2.1
diff -c -3 -p -r2.35.2.1 tree-data-ref.c
*** tree-data-ref.c	2 Sep 2005 16:42:54 -0000	2.35.2.1
--- tree-data-ref.c	14 Sep 2005 11:06:22 -0000
*************** analyze_array (tree stmt, tree ref, bool
*** 845,851 ****
    struct data_reference *res;
    VEC(tree,heap) *acc_fns;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(analyze_array \n");
        fprintf (dump_file, "  (ref = ");
--- 845,851 ----
    struct data_reference *res;
    VEC(tree,heap) *acc_fns;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(analyze_array \n");
        fprintf (dump_file, "  (ref = ");
*************** analyze_array (tree stmt, tree ref, bool
*** 871,877 ****
    DR_MEMTAG (res) = NULL_TREE;
    DR_PTR_INFO (res) = NULL;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
    
    return res;
--- 871,877 ----
    DR_MEMTAG (res) = NULL_TREE;
    DR_PTR_INFO (res) = NULL;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
    
    return res;
*************** analyze_indirect_ref (tree stmt, tree re
*** 900,906 ****
    STRIP_NOPS (init);   
    if (access_fn == chrec_dont_know || !init || init == chrec_dont_know)
      {
!       if (dump_file && (dump_flags & TDF_DETAILS))
  	{
  	  fprintf (dump_file, "\nBad access function of ptr: ");
  	  print_generic_expr (dump_file, ref, TDF_SLIM);
--- 900,906 ----
    STRIP_NOPS (init);   
    if (access_fn == chrec_dont_know || !init || init == chrec_dont_know)
      {
!       if (dump_file && (dump_flags & TDF_ANALYSIS))
  	{
  	  fprintf (dump_file, "\nBad access function of ptr: ");
  	  print_generic_expr (dump_file, ref, TDF_SLIM);
*************** analyze_indirect_ref (tree stmt, tree re
*** 909,915 ****
        return NULL;
      }
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "\nAccess function of ptr: ");
        print_generic_expr (dump_file, access_fn, TDF_SLIM);
--- 909,915 ----
        return NULL;
      }
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "\nAccess function of ptr: ");
        print_generic_expr (dump_file, access_fn, TDF_SLIM);
*************** analyze_indirect_ref (tree stmt, tree re
*** 918,924 ****
  
    if (!expr_invariant_in_loop_p (loop, init))
      {
!     if (dump_file && (dump_flags & TDF_DETAILS))
  	fprintf (dump_file, "\ninitial condition is not loop invariant.\n");	
      }
    else
--- 918,924 ----
  
    if (!expr_invariant_in_loop_p (loop, init))
      {
!     if (dump_file && (dump_flags & TDF_ANALYSIS))
  	fprintf (dump_file, "\ninitial condition is not loop invariant.\n");	
      }
    else
*************** analyze_indirect_ref (tree stmt, tree re
*** 934,945 ****
  	      if (TREE_CODE (evolution) == INTEGER_CST)
  		step = fold_convert (ssizetype, evolution);
  	      else
! 		if (dump_file && (dump_flags & TDF_DETAILS))
  		  fprintf (dump_file, "\nnon constant step for ptr access.\n");	
  	    }
  	}
        else
! 	if (dump_file && (dump_flags & TDF_DETAILS))
  	  fprintf (dump_file, "\nunknown evolution of ptr.\n");	
      }
    return init_data_ref (stmt, ref, NULL_TREE, access_fn, is_read, base_address, 
--- 934,945 ----
  	      if (TREE_CODE (evolution) == INTEGER_CST)
  		step = fold_convert (ssizetype, evolution);
  	      else
! 		if (dump_file && (dump_flags & TDF_ANALYSIS))
  		  fprintf (dump_file, "\nnon constant step for ptr access.\n");	
  	    }
  	}
        else
! 	if (dump_file && (dump_flags & TDF_ANALYSIS))
  	  fprintf (dump_file, "\nunknown evolution of ptr.\n");	
      }
    return init_data_ref (stmt, ref, NULL_TREE, access_fn, is_read, base_address, 
*************** init_data_ref (tree stmt, 
*** 967,973 ****
    struct data_reference *res;
    VEC(tree,heap) *acc_fns;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(init_data_ref \n");
        fprintf (dump_file, "  (ref = ");
--- 967,973 ----
    struct data_reference *res;
    VEC(tree,heap) *acc_fns;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(init_data_ref \n");
        fprintf (dump_file, "  (ref = ");
*************** init_data_ref (tree stmt, 
*** 993,999 ****
    DR_MEMTAG (res) = memtag;
    DR_PTR_INFO (res) = ptr_info;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
    
    return res;
--- 993,999 ----
    DR_MEMTAG (res) = memtag;
    DR_PTR_INFO (res) = ptr_info;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
    
    return res;
*************** analyze_offset_expr (tree expr, 
*** 1137,1143 ****
    if (!BINARY_CLASS_P (expr))
      {
        /* We expect to get binary expressions (PLUS/MINUS and MULT).  */
!       if (dump_file && (dump_flags & TDF_DETAILS))
          {
  	  fprintf (dump_file, "\nNot binary expression ");
            print_generic_expr (dump_file, expr, TDF_SLIM);
--- 1137,1143 ----
    if (!BINARY_CLASS_P (expr))
      {
        /* We expect to get binary expressions (PLUS/MINUS and MULT).  */
!       if (dump_file && (dump_flags & TDF_ANALYSIS))
          {
  	  fprintf (dump_file, "\nNot binary expression ");
            print_generic_expr (dump_file, expr, TDF_SLIM);
*************** address_analysis (tree expr, tree stmt, 
*** 1301,1307 ****
  	 address.  */
        if ((base_addr0 && base_addr1) || (!base_addr0 && !base_addr1))
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, 
  		    "\neither more than one address or no addresses in expr ");
--- 1301,1307 ----
  	 address.  */
        if ((base_addr0 && base_addr1) || (!base_addr0 && !base_addr1))
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, 
  		    "\neither more than one address or no addresses in expr ");
*************** address_analysis (tree expr, tree stmt, 
*** 1347,1353 ****
      case SSA_NAME:
        if (!POINTER_TYPE_P (TREE_TYPE (expr)))
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nnot pointer SSA_NAME ");
  	      print_generic_expr (dump_file, expr, TDF_SLIM);
--- 1347,1353 ----
      case SSA_NAME:
        if (!POINTER_TYPE_P (TREE_TYPE (expr)))
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nnot pointer SSA_NAME ");
  	      print_generic_expr (dump_file, expr, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1459,1465 ****
  	  else
  	    {
  	      /* FORNOW.  */
! 	      if (dump_file && (dump_flags & TDF_DETAILS))
  		{
  		  fprintf (dump_file, "\ndata-ref of unsupported type ");
  		  print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1459,1465 ----
  	  else
  	    {
  	      /* FORNOW.  */
! 	      if (dump_file && (dump_flags & TDF_ANALYSIS))
  		{
  		  fprintf (dump_file, "\ndata-ref of unsupported type ");
  		  print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1475,1481 ****
  				  &pmode, &punsignedp, &pvolatilep, false);
        if (!base)
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nfailed to get inner ref for ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1475,1481 ----
  				  &pmode, &punsignedp, &pvolatilep, false);
        if (!base)
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nfailed to get inner ref for ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1490,1496 ****
  				   &object_misalign, &object_aligned_to,
  				   &object_step))
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nfailed to compute offset or step for ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1490,1496 ----
  				   &object_misalign, &object_aligned_to,
  				   &object_step))
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nfailed to compute offset or step for ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1505,1511 ****
        /* Check that there is no remainder in bits.  */
        if (pbitpos%BITS_PER_UNIT)
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    fprintf (dump_file, "\nbit offset alignment.\n");
  	  return NULL_TREE;
  	}
--- 1505,1511 ----
        /* Check that there is no remainder in bits.  */
        if (pbitpos%BITS_PER_UNIT)
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    fprintf (dump_file, "\nbit offset alignment.\n");
  	  return NULL_TREE;
  	}
*************** object_analysis (tree memref, tree stmt,
*** 1524,1530 ****
        /* We expect to get a decl only if we already have a DR.  */
        if (!(*dr))
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nunhandled decl ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1524,1530 ----
        /* We expect to get a decl only if we already have a DR.  */
        if (!(*dr))
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nunhandled decl ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1562,1568 ****
        ptr_dr = analyze_indirect_ref (stmt, memref, is_read);
        if (!ptr_dr)
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nfailed to create dr for ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1562,1568 ----
        ptr_dr = analyze_indirect_ref (stmt, memref, is_read);
        if (!ptr_dr)
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nfailed to create dr for ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1577,1583 ****
        if (!ptr_init || !ptr_step || !POINTER_TYPE_P (TREE_TYPE (ptr_init)))
  	{
  	  *dr = (*dr) ? *dr : ptr_dr;
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nbad pointer access ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1577,1583 ----
        if (!ptr_init || !ptr_step || !POINTER_TYPE_P (TREE_TYPE (ptr_init)))
  	{
  	  *dr = (*dr) ? *dr : ptr_dr;
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nbad pointer access ");
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1588,1594 ****
  
        if (integer_zerop (ptr_step) && !(*dr))
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS)) 
  	    fprintf (dump_file, "\nptr is loop invariant.\n");	
  	  *dr = ptr_dr;
  	  return NULL_TREE;
--- 1588,1594 ----
  
        if (integer_zerop (ptr_step) && !(*dr))
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS)) 
  	    fprintf (dump_file, "\nptr is loop invariant.\n");	
  	  *dr = ptr_dr;
  	  return NULL_TREE;
*************** object_analysis (tree memref, tree stmt,
*** 1610,1616 ****
  				       &address_aligned_to, &address_step);
        if (!base_address)
  	{
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nfailed to analyze address ");
  	      print_generic_expr (dump_file, ptr_init, TDF_SLIM);
--- 1610,1616 ----
  				       &address_aligned_to, &address_step);
        if (!base_address)
  	{
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nfailed to analyze address ");
  	      print_generic_expr (dump_file, ptr_init, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1632,1638 ****
  	  *memtag = TREE_OPERAND (base_address, 0);
  	  break;
  	default:
! 	  if (dump_file && (dump_flags & TDF_DETAILS))
  	    {
  	      fprintf (dump_file, "\nno memtag for "); 
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1632,1638 ----
  	  *memtag = TREE_OPERAND (base_address, 0);
  	  break;
  	default:
! 	  if (dump_file && (dump_flags & TDF_ANALYSIS))
  	    {
  	      fprintf (dump_file, "\nno memtag for "); 
  	      print_generic_expr (dump_file, memref, TDF_SLIM);
*************** object_analysis (tree memref, tree stmt,
*** 1646,1652 ****
    if (!base_address)
      {
        /* MEMREF cannot be analyzed.  */
!       if (dump_file && (dump_flags & TDF_DETAILS))
  	{
  	  fprintf (dump_file, "\ndata-ref of unsupported type ");
  	  print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1646,1652 ----
    if (!base_address)
      {
        /* MEMREF cannot be analyzed.  */
!       if (dump_file && (dump_flags & TDF_ANALYSIS))
  	{
  	  fprintf (dump_file, "\ndata-ref of unsupported type ");
  	  print_generic_expr (dump_file, memref, TDF_SLIM);
*************** create_data_ref (tree memref, tree stmt,
*** 1762,1768 ****
  				  &ptr_info, &subvars);
    if (!dr || !base_address)
      {
!       if (dump_file && (dump_flags & TDF_DETAILS))
  	{
  	  fprintf (dump_file, "\ncreate_data_ref: failed to create a dr for ");
  	  print_generic_expr (dump_file, memref, TDF_SLIM);
--- 1762,1768 ----
  				  &ptr_info, &subvars);
    if (!dr || !base_address)
      {
!       if (dump_file && (dump_flags & TDF_ANALYSIS))
  	{
  	  fprintf (dump_file, "\ncreate_data_ref: failed to create a dr for ");
  	  print_generic_expr (dump_file, memref, TDF_SLIM);
*************** create_data_ref (tree memref, tree stmt,
*** 1825,1831 ****
        VEC_replace (tree, DR_ACCESS_FNS (dr), 0, access_fn);
      }
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        struct ptr_info_def *pi = DR_PTR_INFO (dr);
  
--- 1825,1831 ----
        VEC_replace (tree, DR_ACCESS_FNS (dr), 0, access_fn);
      }
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        struct ptr_info_def *pi = DR_PTR_INFO (dr);
  
*************** static inline void
*** 2009,2015 ****
  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);
--- 2009,2015 ----
  finalize_ddr_dependent (struct data_dependence_relation *ddr, 
  			tree chrec)
  {
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(dependence classified: ");
        print_generic_expr (dump_file, chrec, 0);
*************** finalize_ddr_dependent (struct data_depe
*** 2026,2032 ****
  static inline void
  non_affine_dependence_relation (struct data_dependence_relation *ddr)
  {
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(Dependence relation cannot be represented by distance vector.) \n");
  
    DDR_AFFINE_P (ddr) = false;
--- 2026,2032 ----
  static inline void
  non_affine_dependence_relation (struct data_dependence_relation *ddr)
  {
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(Dependence relation cannot be represented by distance vector.) \n");
  
    DDR_AFFINE_P (ddr) = false;
*************** analyze_ziv_subscript (tree chrec_a, 
*** 2100,2106 ****
  {
    tree difference;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_ziv_subscript \n");
    
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
--- 2100,2106 ----
  {
    tree difference;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(analyze_ziv_subscript \n");
    
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
*************** analyze_ziv_subscript (tree chrec_a, 
*** 2134,2140 ****
        break;
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  }
  
--- 2134,2140 ----
        break;
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  }
  
*************** analyze_subscript_affine_affine (tree ch
*** 2484,2490 ****
    int tau1, tau2;
    lambda_matrix A, U, S;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_subscript_affine_affine \n");
    
    /* For determining the initial intersection, we have to solve a
--- 2484,2490 ----
    int tau1, tau2;
    lambda_matrix A, U, S;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(analyze_subscript_affine_affine \n");
    
    /* For determining the initial intersection, we have to solve a
*************** analyze_subscript_affine_affine (tree ch
*** 2747,2753 ****
      }
  
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (overlaps_a = ");
        print_generic_expr (dump_file, *overlaps_a, 0);
--- 2747,2753 ----
      }
  
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (overlaps_a = ");
        print_generic_expr (dump_file, *overlaps_a, 0);
*************** analyze_subscript_affine_affine (tree ch
*** 2756,2762 ****
        fprintf (dump_file, ")\n");
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  }
  
--- 2756,2762 ----
        fprintf (dump_file, ")\n");
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  }
  
*************** analyze_siv_subscript (tree chrec_a, 
*** 2774,2780 ****
  		       tree *overlaps_b, 
  		       tree *last_conflicts)
  {
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_siv_subscript \n");
    
    if (evolution_function_is_constant_p (chrec_a)
--- 2774,2780 ----
  		       tree *overlaps_b, 
  		       tree *last_conflicts)
  {
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(analyze_siv_subscript \n");
    
    if (evolution_function_is_constant_p (chrec_a)
*************** analyze_siv_subscript (tree chrec_a, 
*** 2798,2804 ****
        *last_conflicts = chrec_dont_know;
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  }
  
--- 2798,2804 ----
        *last_conflicts = chrec_dont_know;
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  }
  
*************** analyze_miv_subscript (tree chrec_a, 
*** 2845,2851 ****
    */
    tree difference;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(analyze_miv_subscript \n");
    
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
--- 2845,2851 ----
    */
    tree difference;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(analyze_miv_subscript \n");
    
    difference = chrec_fold_minus (integer_type_node, chrec_a, chrec_b);
*************** analyze_miv_subscript (tree chrec_a, 
*** 2904,2910 ****
        *last_conflicts = chrec_dont_know;
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  }
  
--- 2904,2910 ----
        *last_conflicts = chrec_dont_know;
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  }
  
*************** analyze_overlapping_iterations (tree chr
*** 2925,2931 ****
  				tree *overlap_iterations_b, 
  				tree *last_conflicts)
  {
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(analyze_overlapping_iterations \n");
        fprintf (dump_file, "  (chrec_a = ");
--- 2925,2931 ----
  				tree *overlap_iterations_b, 
  				tree *last_conflicts)
  {
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(analyze_overlapping_iterations \n");
        fprintf (dump_file, "  (chrec_a = ");
*************** analyze_overlapping_iterations (tree chr
*** 2961,2967 ****
  			   overlap_iterations_a, overlap_iterations_b,
  			   last_conflicts);
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (overlap_iterations_a = ");
        print_generic_expr (dump_file, *overlap_iterations_a, 0);
--- 2961,2967 ----
  			   overlap_iterations_a, overlap_iterations_b,
  			   last_conflicts);
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (overlap_iterations_a = ");
        print_generic_expr (dump_file, *overlap_iterations_a, 0);
*************** subscript_dependence_tester (struct data
*** 2985,2991 ****
    struct data_reference *drb = DDR_B (ddr);
    tree last_conflicts;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(subscript_dependence_tester \n");
    
    for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++)
--- 2985,2991 ----
    struct data_reference *drb = DDR_B (ddr);
    tree last_conflicts;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(subscript_dependence_tester \n");
    
    for (i = 0; i < DDR_NUM_SUBSCRIPTS (ddr); i++)
*************** subscript_dependence_tester (struct data
*** 3020,3026 ****
   	}
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  }
  
--- 3020,3026 ----
   	}
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  }
  
*************** compute_affine_dependence (struct data_d
*** 3432,3438 ****
    struct data_reference *dra = DDR_A (ddr);
    struct data_reference *drb = DDR_B (ddr);
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(compute_affine_dependence\n");
        fprintf (dump_file, "  (stmt_a = \n");
--- 3432,3438 ----
    struct data_reference *dra = DDR_A (ddr);
    struct data_reference *drb = DDR_B (ddr);
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(compute_affine_dependence\n");
        fprintf (dump_file, "  (stmt_a = \n");
*************** compute_affine_dependence (struct data_d
*** 3456,3462 ****
  	finalize_ddr_dependent (ddr, chrec_dont_know);
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  }
  
--- 3456,3462 ----
  	finalize_ddr_dependent (ddr, chrec_dont_know);
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  }
  
*************** analyze_all_data_dependences (struct loo
*** 3774,3780 ****
        dump_data_dependence_relations (dump_file, dependence_relations);
        fprintf (dump_file, "\n\n");
  
!       if (dump_flags & TDF_DETAILS)
  	dump_dist_dir_vectors (dump_file, dependence_relations);
  
        if (dump_flags & TDF_STATS)
--- 3774,3780 ----
        dump_data_dependence_relations (dump_file, dependence_relations);
        fprintf (dump_file, "\n\n");
  
!       if (dump_flags & TDF_ANALYSIS)
  	dump_dist_dir_vectors (dump_file, dependence_relations);
  
        if (dump_flags & TDF_STATS)
Index: tree-dump.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-dump.c,v
retrieving revision 1.48.2.1
diff -c -3 -p -r1.48.2.1 tree-dump.c
*** tree-dump.c	2 Sep 2005 16:42:55 -0000	1.48.2.1
--- tree-dump.c	14 Sep 2005 11:06:22 -0000
*************** static const struct dump_option_value_in
*** 750,755 ****
--- 750,756 ----
    {"vops", TDF_VOPS},
    {"lineno", TDF_LINENO},
    {"uid", TDF_UID},
+   {"analysis", TDF_ANALYSIS},
    {"stmtaddr", TDF_STMTADDR},
    {"all", ~(TDF_RAW | TDF_SLIM | TDF_LINENO | TDF_TREE | TDF_RTL | TDF_IPA 
  	    | TDF_STMTADDR | TDF_GRAPH)},
Index: tree-pass.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-pass.h,v
retrieving revision 2.53.2.1
diff -c -3 -p -r2.53.2.1 tree-pass.h
*** tree-pass.h	2 Sep 2005 16:43:02 -0000	2.53.2.1
--- tree-pass.h	14 Sep 2005 11:06:22 -0000
*************** enum tree_dump_index
*** 50,73 ****
  /* Bit masks to control dumping. Not all values are applicable to
     all dumps. Add new ones at the end. When you define new
     values, extend the DUMP_OPTIONS array in tree-dump.c */
! #define TDF_ADDRESS	(1 << 0)	/* dump node addresses */
! #define TDF_SLIM	(1 << 1)	/* don't go wild following links */
! #define TDF_RAW  	(1 << 2)	/* don't unparse the function */
! #define TDF_DETAILS	(1 << 3)	/* show more detailed info about
! 					   each pass */
! #define TDF_STATS	(1 << 4)	/* dump various statistics about
! 					   each pass */
! #define TDF_BLOCKS	(1 << 5)	/* display basic block boundaries */
! #define TDF_VOPS	(1 << 6)	/* display virtual operands */
! #define TDF_LINENO	(1 << 7)	/* display statement line numbers */
! #define TDF_UID		(1 << 8)	/* display decl UIDs */
! 
! #define TDF_TREE	(1 << 9)	/* is a tree dump */
! #define TDF_RTL		(1 << 10)	/* is a RTL dump */
! #define TDF_IPA		(1 << 11)	/* is an IPA dump */
! #define TDF_STMTADDR	(1 << 12)	/* Address of stmt.  */
  
! #define TDF_GRAPH	(1 << 13)	/* a graph dump is being emitted */
  
  extern char *get_dump_file_name (enum tree_dump_index);
  extern int dump_enabled_p (enum tree_dump_index);
--- 50,75 ----
  /* Bit masks to control dumping. Not all values are applicable to
     all dumps. Add new ones at the end. When you define new
     values, extend the DUMP_OPTIONS array in tree-dump.c */
! enum tdf
! {
!   TDF_ADDRESS =  (1 << 0),	/* dump node addresses */
!   TDF_SLIM =	 (1 << 1),	/* don't go wild following links */
!   TDF_RAW =	 (1 << 2),	/* don't unparse the function */
!   TDF_DETAILS =	 (1 << 3),	/* show more detailed info about each pass */
!   TDF_STATS =	 (1 << 4),	/* dump various statistics about each pass */
!   TDF_BLOCKS =	 (1 << 5),	/* display basic block boundaries */
!   TDF_VOPS =	 (1 << 6),	/* display virtual operands */
!   TDF_LINENO =	 (1 << 7),	/* display statement line numbers */
!   TDF_UID =	 (1 << 8),	/* display decl UIDs */
!   TDF_ANALYSIS = (1 << 9),	/* dump details of on-demand analyses */
! 
!   TDF_TREE =	 (1 << 10),	/* is a tree dump */
!   TDF_RTL =	 (1 << 11),	/* is a RTL dump */
!   TDF_IPA =	 (1 << 12),	/* is an IPA dump */
!   TDF_STMTADDR = (1 << 13),	/* Address of stmt.  */
  
!   TDF_GRAPH =	 (1 << 14)	/* a graph dump is being emitted */
! };
  
  extern char *get_dump_file_name (enum tree_dump_index);
  extern int dump_enabled_p (enum tree_dump_index);
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-scalar-evolution.c,v
retrieving revision 2.31.2.2
diff -c -3 -p -r2.31.2.2 tree-scalar-evolution.c
*** tree-scalar-evolution.c	14 Sep 2005 09:44:18 -0000	2.31.2.2
--- tree-scalar-evolution.c	14 Sep 2005 11:06:22 -0000
*************** set_scalar_evolution (tree scalar, tree 
*** 585,591 ****
    
    if (dump_file)
      {
!       if (dump_flags & TDF_DETAILS)
  	{
  	  fprintf (dump_file, "(set_scalar_evolution \n");
  	  fprintf (dump_file, "  (scalar = ");
--- 585,591 ----
    
    if (dump_file)
      {
!       if (dump_flags & TDF_ANALYSIS)
  	{
  	  fprintf (dump_file, "(set_scalar_evolution \n");
  	  fprintf (dump_file, "  (scalar = ");
*************** get_scalar_evolution (tree scalar)
*** 610,616 ****
    
    if (dump_file)
      {
!       if (dump_flags & TDF_DETAILS)
  	{
  	  fprintf (dump_file, "(get_scalar_evolution \n");
  	  fprintf (dump_file, "  (scalar = ");
--- 610,616 ----
    
    if (dump_file)
      {
!       if (dump_flags & TDF_ANALYSIS)
  	{
  	  fprintf (dump_file, "(get_scalar_evolution \n");
  	  fprintf (dump_file, "  (scalar = ");
*************** get_scalar_evolution (tree scalar)
*** 637,643 ****
        break;
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (scalar_evolution = ");
        print_generic_expr (dump_file, res, 0);
--- 637,643 ----
        break;
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (scalar_evolution = ");
        print_generic_expr (dump_file, res, 0);
*************** add_to_evolution (unsigned loop_nb, 
*** 857,863 ****
      /* This should not happen.  */
      return chrec_dont_know;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(add_to_evolution \n");
        fprintf (dump_file, "  (loop_nb = %d)\n", loop_nb);
--- 857,863 ----
      /* This should not happen.  */
      return chrec_dont_know;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(add_to_evolution \n");
        fprintf (dump_file, "  (loop_nb = %d)\n", loop_nb);
*************** add_to_evolution (unsigned loop_nb, 
*** 875,881 ****
  
    res = add_to_evolution_1 (loop_nb, chrec_before, to_add);
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (res = ");
        print_generic_expr (dump_file, res, 0);
--- 875,881 ----
  
    res = add_to_evolution_1 (loop_nb, chrec_before, to_add);
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (res = ");
        print_generic_expr (dump_file, res, 0);
*************** set_nb_iterations_in_loop (struct loop *
*** 903,909 ****
  	  || TREE_OVERFLOW (res)))
      res = chrec_dont_know;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (set_nb_iterations_in_loop = ");
        print_generic_expr (dump_file, res, 0);
--- 903,909 ----
  	  || TREE_OVERFLOW (res)))
      res = chrec_dont_know;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (set_nb_iterations_in_loop = ");
        print_generic_expr (dump_file, res, 0);
*************** get_loop_exit_condition (struct loop *lo
*** 964,970 ****
    edge exit_edge = loop->single_exit;
  
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(get_loop_exit_condition \n  ");
    
    if (exit_edge)
--- 964,970 ----
    edge exit_edge = loop->single_exit;
  
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(get_loop_exit_condition \n  ");
    
    if (exit_edge)
*************** get_loop_exit_condition (struct loop *lo
*** 976,982 ****
  	res = expr;
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        print_generic_expr (dump_file, res, 0);
        fprintf (dump_file, ")\n");
--- 976,982 ----
  	res = expr;
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        print_generic_expr (dump_file, res, 0);
        fprintf (dump_file, ")\n");
*************** analyze_evolution_in_loop (tree loop_phi
*** 1466,1472 ****
    struct loop *loop = loop_containing_stmt (loop_phi_node);
    basic_block bb;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(analyze_evolution_in_loop \n");
        fprintf (dump_file, "  (loop_phi_node = ");
--- 1466,1472 ----
    struct loop *loop = loop_containing_stmt (loop_phi_node);
    basic_block bb;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(analyze_evolution_in_loop \n");
        fprintf (dump_file, "  (loop_phi_node = ");
*************** analyze_evolution_in_loop (tree loop_phi
*** 1510,1516 ****
        evolution_function = chrec_merge (evolution_function, ev_fn);
      }
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (evolution_function = ");
        print_generic_expr (dump_file, evolution_function, 0);
--- 1510,1516 ----
        evolution_function = chrec_merge (evolution_function, ev_fn);
      }
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (evolution_function = ");
        print_generic_expr (dump_file, evolution_function, 0);
*************** analyze_initial_condition (tree loop_phi
*** 1534,1540 ****
    tree init_cond = chrec_not_analyzed_yet;
    struct loop *loop = bb_for_stmt (loop_phi_node)->loop_father;
    
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(analyze_initial_condition \n");
        fprintf (dump_file, "  (loop_phi_node = \n");
--- 1534,1540 ----
    tree init_cond = chrec_not_analyzed_yet;
    struct loop *loop = bb_for_stmt (loop_phi_node)->loop_father;
    
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(analyze_initial_condition \n");
        fprintf (dump_file, "  (loop_phi_node = \n");
*************** analyze_initial_condition (tree loop_phi
*** 1571,1577 ****
    if (init_cond == chrec_not_analyzed_yet)
      init_cond = chrec_dont_know;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (init_cond = ");
        print_generic_expr (dump_file, init_cond, 0);
--- 1571,1577 ----
    if (init_cond == chrec_not_analyzed_yet)
      init_cond = chrec_dont_know;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (init_cond = ");
        print_generic_expr (dump_file, init_cond, 0);
*************** analyze_scalar_evolution (struct loop *l
*** 1844,1850 ****
  {
    tree res;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(analyze_scalar_evolution \n");
        fprintf (dump_file, "  (loop_nb = %d)\n", loop->num);
--- 1844,1850 ----
  {
    tree res;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(analyze_scalar_evolution \n");
        fprintf (dump_file, "  (loop_nb = %d)\n", loop->num);
*************** analyze_scalar_evolution (struct loop *l
*** 1858,1864 ****
    if (TREE_CODE (var) == SSA_NAME && res == chrec_dont_know)
      res = var;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, ")\n");
  
    return res;
--- 1858,1864 ----
    if (TREE_CODE (var) == SSA_NAME && res == chrec_dont_know)
      res = var;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, ")\n");
  
    return res;
*************** instantiate_parameters (struct loop *loo
*** 2176,2182 ****
    tree res;
    htab_t cache = htab_create (10, hash_scev_info, eq_scev_info, del_scev_info);
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "(instantiate_parameters \n");
        fprintf (dump_file, "  (loop_nb = %d)\n", loop->num);
--- 2176,2182 ----
    tree res;
    htab_t cache = htab_create (10, hash_scev_info, eq_scev_info, del_scev_info);
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "(instantiate_parameters \n");
        fprintf (dump_file, "  (loop_nb = %d)\n", loop->num);
*************** instantiate_parameters (struct loop *loo
*** 2187,2193 ****
   
    res = instantiate_parameters_1 (loop, chrec, INSERT_SUPERLOOP_CHRECS, cache);
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      {
        fprintf (dump_file, "  (res = ");
        print_generic_expr (dump_file, res, 0);
--- 2187,2193 ----
   
    res = instantiate_parameters_1 (loop, chrec, INSERT_SUPERLOOP_CHRECS, cache);
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      {
        fprintf (dump_file, "  (res = ");
        print_generic_expr (dump_file, res, 0);
*************** number_of_iterations_in_loop (struct loo
*** 2247,2253 ****
      return res;
    res = chrec_dont_know;
  
!   if (dump_file && (dump_flags & TDF_DETAILS))
      fprintf (dump_file, "(number_of_iterations_in_loop\n");
    
    exit = loop->single_exit;
--- 2247,2253 ----
      return res;
    res = chrec_dont_know;
  
!   if (dump_file && (dump_flags & TDF_ANALYSIS))
      fprintf (dump_file, "(number_of_iterations_in_loop\n");
    
    exit = loop->single_exit;



More information about the Gcc-patches mailing list