From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77813 invoked by alias); 11 Sep 2019 12:58:07 -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 77805 invoked by uid 89); 11 Sep 2019 12:58:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,SPF_PASS autolearn=ham version=3.3.1 spammy=ick X-HELO: mx1.suse.de Received: from mx2.suse.de (HELO mx1.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Sep 2019 12:58:04 +0000 Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 8C829AF3B; Wed, 11 Sep 2019 12:58:02 +0000 (UTC) Subject: Re: [PATCH 2/9] operand_equal_p: add support for FIELD_DECL To: Jan Hubicka , Richard Biener Cc: GCC Patches References: <94fde27bc6206d87448943f5d331c35fcd69901f.1565105736.git.mliska@suse.cz> <20190815141727.m4qismzapuvy2vcy@kam.mff.cuni.cz> <20190816120923.idk2di6iabehmwkj@kam.mff.cuni.cz> From: =?UTF-8?Q?Martin_Li=c5=a1ka?= Message-ID: <005baafd-f5c4-6541-eacf-ddfd69e64405@suse.cz> Date: Wed, 11 Sep 2019 12:58:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190816120923.idk2di6iabehmwkj@kam.mff.cuni.cz> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00739.txt.bz2 On 8/16/19 2:09 PM, Jan Hubicka wrote: >> On Thu, Aug 15, 2019 at 4:17 PM Jan Hubicka wrote: >>> >>>> On Tue, Aug 6, 2019 at 5:44 PM Martin Liska wrote: >>>>> >>>>> >>>>> gcc/ChangeLog: >>>> >>>> So I suppose this isn't to call operand_equal_p on two FIELD_DECLs >>>> but to make two COMPONENT_REFs "more equal"? If so I then >>> >>> yes. The patch originates from my original patchset I believe and it is >>> what ICF does. >>>> I suggest to make this change "local" to the COMPONENT_REF handling. >>>> This also interacts with path-based disambiguation so you want to make >>>> sure to only make things equal here iff it wouldn't change the outcome >>>> of path-based analysis. Honza? >>> >>> Indeed this can be handled as part of COMPONENT_REF match. >>> Access path oracle here basically checks: >>> 1) that MEM_REF type matches (we want predicate for this) >>> 2) if it finds type match via same_type_for_tbaa and then it applies >>> the assumption about disjointness or overlap >>> >>> So I guess ideally we should >>> >>> 1) do matching part of COMPONENT_REF >>> 2) compare OFFSET, BIT_OFFSET >>> This establishes that the access has same semantics. >>> 3) for -fno-strict-aliasing be happy >>> 4) for -fstrict-aliaisng check if access path applies (we should export >>> predicate from tree-ssa-alias as discussed earlier) >>> 5) compare types by same_type_for_tbaa_p >> >> Ick. This smells like a layering violation to me. IMHO this extended >> equality handling should be handled with the overloading/callback >> and not in native operand_equal_p. Either on the level of the >> COMPONENT_REF itself (sounds like that would be needed) >> or the FIELD_DECL. Not sure if the above suggestions make >> it neccessary to look at more than a single COMPONENT_REF/FIELD_DECL >> in the access path. If so then watch out for quadraticness as operand_equal_p >> traverses a reference chain... > > I suppose we want to match whole access paths at once, since only having > the MEM_REF allows one to check whether access path oracle applies to > the given reference or not... Doing that, can you please Honza point me to a function that should be used for it? Martin > > Honza >> >> Richard. >> >>> Honza