public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Richard Guenther <rguenther@suse.de>
Subject: [PATCH, SRA] Dump that a structure is too big for total scalarization
Date: Thu, 07 Jul 2011 18:44:00 -0000	[thread overview]
Message-ID: <20110707183713.GC3584@virgil.arch.suse.de> (raw)

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?

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));
  	      }
  	  }
        }

             reply	other threads:[~2011-07-07 18:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-07 18:44 Martin Jambor [this message]
2011-07-08  8:33 ` Richard Guenther

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110707183713.GC3584@virgil.arch.suse.de \
    --to=mjambor@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).