public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: Handle CONSTRUCTOR in operand_equal_p
Date: Thu, 15 Oct 2015 06:57:00 -0000	[thread overview]
Message-ID: <9FF55B7D-8DEC-45C4-8FDD-5AA0344B2B15@suse.de> (raw)
In-Reply-To: <20151014235509.GC16831@kam.mff.cuni.cz>

On October 15, 2015 1:55:09 AM GMT+02:00, Jan Hubicka <hubicka@ucw.cz> wrote:
>> On October 14, 2015 6:27:02 PM GMT+02:00, Jan Hubicka
><hubicka@ucw.cz> wrote:
>> >Hi,
>> >this patch adds the CONSTRUCTOR case discussed while back.  Only
>empty
>> >constructors are matched, as those are only appearing in gimple
>> >operand.
>> >I tested that during bootstrap about 7500 matches are for empty
>ctors.
>> >There are couple hundred for non-empty probably used on generic. 
>> >
>> >Bootstrapped/regtested x86_64-linux, OK?
>> >
>> >Honza
>> >
>> >	* fold-const.c (operand_equal_p): Match empty constructors.
>> >Index: fold-const.c
>> >===================================================================
>> >--- fold-const.c	(revision 228735)
>> >+++ fold-const.c	(working copy)
>> >@@ -2890,6 +2891,11 @@ operand_equal_p (const_tree arg0, const_
>> >	return operand_equal_p (TREE_OPERAND (arg0, 0), TREE_OPERAND (arg1,
>> >0),
>> > 				flags | OEP_ADDRESS_OF
>> > 				| OEP_CONSTANT_ADDRESS_OF);
>> >+      case CONSTRUCTOR:
>> >+	/* In GIMPLE empty constructors are allowed in initializers of
>> >+	   vector types.  */
>> 
>> The comment is wrong (or at least odd),
>> On gimple an empty vector constructor should be folded to a
>VECTOR_CST.
>
>Hmm, I tought we have a={} i.e. for clearing whole structure.

Yes we do, but then the comment should refer to aggregate types.

>If we never have constructors appearing as gimple operands, I guess we
>don't
>really need the code at gimple level (because at least so far ipa-icf
>has
>separate path to compare constructors).
>
>Honza
>> 
>> >+	return (!vec_safe_length (CONSTRUCTOR_ELTS (arg0))
>> >+		&& !vec_safe_length (CONSTRUCTOR_ELTS (arg1)));
>> >       default:
>> > 	break;
>> >       }
>> 


  reply	other threads:[~2015-10-15  6:57 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-14 16:27 Jan Hubicka
2015-10-14 17:26 ` Jeff Law
2015-10-14 17:35   ` Jan Hubicka
2015-10-14 18:42 ` Richard Biener
2015-10-14 23:55   ` Jan Hubicka
2015-10-15  6:57     ` Richard Biener [this message]
2015-10-21 19:10       ` Jan Hubicka
2015-10-22  7:39         ` Richard Biener
2015-10-23  5:43           ` Jan Hubicka

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=9FF55B7D-8DEC-45C4-8FDD-5AA0344B2B15@suse.de \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    /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).