From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32725 invoked by alias); 15 Oct 2015 06:57:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 32710 invoked by uid 89); 15 Oct 2015 06:57:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Thu, 15 Oct 2015 06:57:00 +0000 Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 297E3AB1A; Thu, 15 Oct 2015 06:56:56 +0000 (UTC) User-Agent: K-9 Mail for Android In-Reply-To: <20151014235509.GC16831@kam.mff.cuni.cz> References: <20151014162702.GD16672@kam.mff.cuni.cz> <20151014235509.GC16831@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: Handle CONSTRUCTOR in operand_equal_p From: Richard Biener Date: Thu, 15 Oct 2015 06:57:00 -0000 To: Jan Hubicka CC: gcc-patches@gcc.gnu.org Message-ID: <9FF55B7D-8DEC-45C4-8FDD-5AA0344B2B15@suse.de> X-SW-Source: 2015-10/txt/msg01437.txt.bz2 On October 15, 2015 1:55:09 AM GMT+02:00, Jan Hubicka wrote: >> On October 14, 2015 6:27:02 PM GMT+02:00, Jan Hubicka > 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; >> > } >>