From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 237933858C01 for ; Fri, 29 Sep 2023 09:13:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 237933858C01 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 4611C1F390; Fri, 29 Sep 2023 09:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1695978819; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eftOWnDglFYLCSkKP7n3fDwelUaCXY+UNLm6vymQkF0=; b=Abo6LdWVlv6Hl4FxwlD7n4ugACDCJXCjWWLR5qSVeM0S3mtNTNkY/f8ZCeGCXhQgotEtY7 7MqNvVuR6vM/BaFPXpl02R2gdzR/Pj4mOg1Y30mtpEst28Ebe/vO79s7lbL25peloz1TnZ wdM5q8/s18+nJc9Ur50ZT9XJChkgVi4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1695978819; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eftOWnDglFYLCSkKP7n3fDwelUaCXY+UNLm6vymQkF0=; b=FkarpAeMMumqhxde1w6A+FjGM/WiuYbca0RP75yYhdFp0i5JVYWp3LMjX5Aa4dw4UXabX/ stcd9ysDsvbYXcBw== Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 1FA1C2C142; Fri, 29 Sep 2023 09:13:39 +0000 (UTC) Date: Fri, 29 Sep 2023 09:13:39 +0000 (UTC) From: Richard Biener To: Jakub Jelinek cc: Jonathan Wakely , Richard Sandiford , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] use *_grow_cleared rather than *_grow on vect_unpromoted_value In-Reply-To: Message-ID: References: User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Fri, 29 Sep 2023, Jakub Jelinek wrote: > On Wed, Sep 27, 2023 at 11:15:26AM +0000, Richard Biener wrote: > > > tree-vect-patterns.cc:2947 unprom.quick_grow (nops); > > > T = vect_unpromoted_value > > > Go for quick_grow_cleared? Something else? > > > > The CTOR zero-initializes everything, so maybe it can go. In theory > > .set_op could also be changed to .push_op ... > > So, I had a look at this and I think using quick_grow_cleared is best choice > here. The nops is 2 or 1 most of the time, worst case 3, so the price of > extra initialization of 4 pointer-sized-or-less members times 1, 2 or 3 > doesn't seem worth bothering, it is similar to the bitmap_head case where > we already pay the price for just one structure anytime we do > vect_unpromoted_value unprom_diff; > (and later set_op on it) or even > vect_unpromoted_value unprom0[2]; > > With this patch and Richard S's poly_int_pod removal the static_assert can > be enabled as well and gcc builds. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. > The second patch waits for the poly_int_pod removal commit and has been just > build tested but not bootstrapped yet. > > 2023-09-29 Jakub Jelinek > > * tree-vect-patterns.cc (vect_recog_over_widening_pattern): Use > quick_grow_cleared method on unprom rather than quick_grow. > > --- gcc/tree-vect-patterns.cc.jj 2023-08-24 15:37:29.321410276 +0200 > +++ gcc/tree-vect-patterns.cc 2023-09-29 09:45:27.980168865 +0200 > @@ -2944,7 +2944,7 @@ vect_recog_over_widening_pattern (vec_in > /* Check the operands. */ > unsigned int nops = gimple_num_ops (last_stmt) - first_op; > auto_vec unprom (nops); > - unprom.quick_grow (nops); > + unprom.quick_grow_cleared (nops); > unsigned int min_precision = 0; > bool single_use_p = false; > for (unsigned int i = 0; i < nops; ++i) > > > Jakub > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew McDonald, Werner Knoblich; (HRB 36809, AG Nuernberg)