From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16121 invoked by alias); 7 Jan 2019 14:32:12 -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 15858 invoked by uid 89); 7 Jan 2019 14:32:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,KAM_ASCII_DIVIDERS,KAM_NUMSUBJECT,SPF_PASS autolearn=ham version=3.3.2 spammy=our 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; Mon, 07 Jan 2019 14:32:07 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id A62D7AEBD; Mon, 7 Jan 2019 14:32:04 +0000 (UTC) Date: Mon, 07 Jan 2019 14:32:00 -0000 From: Richard Biener To: Richard Sandiford cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR85574 In-Reply-To: Message-ID: References: <87y381rgkk.fsf@arm.com> User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2019-01/txt/msg00304.txt.bz2 On Thu, 3 Jan 2019, Richard Biener wrote: > On Thu, 3 Jan 2019, Richard Sandiford wrote: > > > Richard Biener writes: > > > The following rectifies a change during hash-map intruction which > > > changed the uncprop operand_equal_p based hash to a pointer-based > > > hash_map. That assumes pointer equality between constants which > > > does not hold since different (but compatible) typed constants > > > can appear in the IL. For SSA names the equivalence holds, of course. > > > > > > Fixing this should increase the number of eliminated const-copies > > > on edges during out-of-SSA. It also happens to fix the LTO > > > bootstrap miscompare of cc1 and friends, but I can't really > > > explain that. > > > > > > [LTO] bootstrapped and tested on x86_64-unknown-linux-gnu, applied > > > to trunk. > > > > > > Richard. > > > > > > 2019-01-03 Jan Hubicka > > > > > > PR tree-optimization/85574 > > > * tree-ssa-uncprop.c (struct equiv_hash_elt): Remove unused > > > structure. > > > (struct ssa_equip_hash_traits): Declare. > > > (val_ssa_equiv): Use custom hash traits using operand_equal_p. > > > > > > Index: gcc/tree-ssa-uncprop.c > > > =================================================================== > > > --- gcc/tree-ssa-uncprop.c (revision 267549) > > > +++ gcc/tree-ssa-uncprop.c (working copy) > > > @@ -268,21 +268,24 @@ associate_equivalences_with_edges (void) > > > so with each value we have a list of SSA_NAMEs that have the > > > same value. */ > > > > > > - > > > -/* Main structure for recording equivalences into our hash table. */ > > > -struct equiv_hash_elt > > > -{ > > > - /* The value/key of this entry. */ > > > - tree value; > > > - > > > - /* List of SSA_NAMEs which have the same value/key. */ > > > - vec equivalences; > > > +/* Traits for the hash_map to record the value to SSA name equivalences > > > + mapping. */ > > > +struct ssa_equip_hash_traits : default_hash_traits > > > +{ > > > + static inline hashval_t hash (value_type value) > > > + { return iterative_hash_expr (value, 0); } > > > + static inline bool equal (value_type existing, value_type candidate) > > > + { return operand_equal_p (existing, candidate, 0); } > > > }; > > > > FWIW, this is a dup of tree_operand_hash. > > Indeed. Testing patch to do the obvious replacement. Bootstrapped and tested on x86_64-unknown-linux-gnu. Richard. 2019-01-07 Richard Biener * tree-ssa-uncprop.c (ssa_equip_hash_traits): Remove in favor of tree_operand_hash. Index: gcc/tree-ssa-uncprop.c =================================================================== --- gcc/tree-ssa-uncprop.c (revision 267553) +++ gcc/tree-ssa-uncprop.c (working copy) @@ -268,19 +268,7 @@ associate_equivalences_with_edges (void) so with each value we have a list of SSA_NAMEs that have the same value. */ -/* Traits for the hash_map to record the value to SSA name equivalences - mapping. */ -struct ssa_equip_hash_traits : default_hash_traits -{ - static inline hashval_t hash (value_type value) - { return iterative_hash_expr (value, 0); } - static inline bool equal (value_type existing, value_type candidate) - { return operand_equal_p (existing, candidate, 0); } -}; - -typedef hash_map, - simple_hashmap_traits > > val_ssa_equiv_t; +typedef hash_map > val_ssa_equiv_t; /* Global hash table implementing a mapping from invariant values to a list of SSA_NAMEs which have the same value. We might be