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, SRA] Dump that a structure is too big for total scalarization


On Thu, 7 Jul 2011, Martin Jambor wrote:

> Hi,
> 
> in order to better analyze what SRA is or is not doing, it is
> sometimes advantageous to have in the dump information that a
> structure was not subject to total scalarization because it was too
> big - if we have detailed dumping on, that is.
> 
> This is accomplished by the patch below.  It is currently undergoing a
> bootstrap and testsuite run on x86_64-linux.  OK if it passes?

Ok.

Thanks,
Richard.

> Thanks,
> 
> Martin
> 
> 
> 2011-07-07  Martin Jambor  <mjambor@suse.cz>
> 
> 	* tree-sra.c (analyze_all_variable_accesses): Dump that a struture
> 	is too big for total scalarization.
> 
> Index: src/gcc/tree-sra.c
> ===================================================================
> *** src.orig/gcc/tree-sra.c
> --- src/gcc/tree-sra.c
> *************** analyze_all_variable_accesses (void)
> *** 2312,2327 ****
>   	tree var = referenced_var (i);
>   
>   	if (TREE_CODE (var) == VAR_DECL
> - 	    && ((unsigned) tree_low_cst (TYPE_SIZE (TREE_TYPE (var)), 1)
> - 		<= max_total_scalarization_size)
>   	    && type_consists_of_records_p (TREE_TYPE (var)))
>   	  {
> ! 	    completely_scalarize_var (var);
> ! 	    if (dump_file && (dump_flags & TDF_DETAILS))
>   	      {
> ! 		fprintf (dump_file, "Will attempt to totally scalarize ");
>   		print_generic_expr (dump_file, var, 0);
> ! 		fprintf (dump_file, " (UID: %u): \n", DECL_UID (var));
>   	      }
>   	  }
>         }
> --- 2312,2335 ----
>   	tree var = referenced_var (i);
>   
>   	if (TREE_CODE (var) == VAR_DECL
>   	    && type_consists_of_records_p (TREE_TYPE (var)))
>   	  {
> ! 	    if ((unsigned) tree_low_cst (TYPE_SIZE (TREE_TYPE (var)), 1)
> ! 		<= max_total_scalarization_size)
> ! 	      {
> ! 		completely_scalarize_var (var);
> ! 		if (dump_file && (dump_flags & TDF_DETAILS))
> ! 		  {
> ! 		    fprintf (dump_file, "Will attempt to totally scalarize ");
> ! 		    print_generic_expr (dump_file, var, 0);
> ! 		    fprintf (dump_file, " (UID: %u): \n", DECL_UID (var));
> ! 		  }
> ! 	      }
> ! 	    else if (dump_file && (dump_flags & TDF_DETAILS))
>   	      {
> ! 		fprintf (dump_file, "Too big to totally scalarize: ");
>   		print_generic_expr (dump_file, var, 0);
> ! 		fprintf (dump_file, " (UID: %u)\n", DECL_UID (var));
>   	      }
>   	  }
>         }
> 
> 

-- 
Richard Guenther <rguenther@suse.de>
Novell / SUSE Labs
SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746
GF: Jeff Hawn, Jennifer Guild, Felix ImendÃrffer

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