From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by sourceware.org (Postfix) with ESMTPS id 4A6553858D1E for ; Wed, 14 Jun 2023 13:46:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4A6553858D1E 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-out1.suse.de (Postfix) with ESMTP id 697C422333; Wed, 14 Jun 2023 13:46:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686750414; 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=TnswlMZfxmqcayY0/+sOfe+5BNimUh2A7O/CwSxMc6s=; b=Dun/4NbB0WU8hRoCGhse6RdV+xR3IuBiu0CULYWOZlnuIHFhiuy0enW/OYA8dxBbPRuZPS zZ/pcGR1/jWN8tiI1we+MUhgZVq/72/wuJ9lce2PEpi6vTdC7Tq+MWXQoJqKFP5S87MCjj ll/+721+uEKS2AY2LB7oavRKOXNbjEY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686750414; 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=TnswlMZfxmqcayY0/+sOfe+5BNimUh2A7O/CwSxMc6s=; b=69YEi4ZEH5j9PRCcWjbFDk1pLMbUXm6MNELQZbrCZw+uwmMi2ogf9uwwQLZgDxVYgGj85b aUY7Qzmrd1OUjaAQ== 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 5D5C82C141; Wed, 14 Jun 2023 13:46:54 +0000 (UTC) Date: Wed, 14 Jun 2023 13:46:54 +0000 (UTC) From: Richard Biener To: Richard Sandiford cc: Richard Biener via Gcc-patches Subject: Re: [PATCH 1/3] Inline vect_get_max_nscalars_per_iter In-Reply-To: Message-ID: References: <20230614114802.BED073858288@sourceware.org> 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=-10.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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 Wed, 14 Jun 2023, Richard Sandiford wrote: > Richard Biener via Gcc-patches writes: > > The function is only meaningful for LOOP_VINFO_MASKS processing so > > inline it into the single use. > > > > Bootstrapped and tested on x86_64-unknown-linux-gnu, OK? > > > > * tree-vect-loop.cc (vect_get_max_nscalars_per_iter): Inline > > into ... > > (vect_verify_full_masking): ... this. > > I think we did have a use for the separate function internally, > but obviously it was never submitted. Personally I'd prefer > to keep things as they are though. OK - after 3/3 it's no longer "generic" (it wasn't before, it doesn't inspect the _len groups either), it's only meaningful for WHILE_ULT style analysis. > > > > --- > > gcc/tree-vect-loop.cc | 22 ++++++---------------- > > 1 file changed, 6 insertions(+), 16 deletions(-) > > > > diff --git a/gcc/tree-vect-loop.cc b/gcc/tree-vect-loop.cc > > index ace9e759f5b..a9695e5b25d 100644 > > --- a/gcc/tree-vect-loop.cc > > +++ b/gcc/tree-vect-loop.cc > > @@ -1117,20 +1117,6 @@ can_produce_all_loop_masks_p (loop_vec_info loop_vinfo, tree cmp_type) > > return true; > > } > > > > -/* Calculate the maximum number of scalars per iteration for every > > - rgroup in LOOP_VINFO. */ > > - > > -static unsigned int > > -vect_get_max_nscalars_per_iter (loop_vec_info loop_vinfo) > > -{ > > - unsigned int res = 1; > > - unsigned int i; > > - rgroup_controls *rgm; > > - FOR_EACH_VEC_ELT (LOOP_VINFO_MASKS (loop_vinfo), i, rgm) > > - res = MAX (res, rgm->max_nscalars_per_iter); > > - return res; > > -} > > - > > /* Calculate the minimum precision necessary to represent: > > > > MAX_NITERS * FACTOR > > @@ -1210,8 +1196,6 @@ static bool > > vect_verify_full_masking (loop_vec_info loop_vinfo) > > { > > unsigned int min_ni_width; > > - unsigned int max_nscalars_per_iter > > - = vect_get_max_nscalars_per_iter (loop_vinfo); > > > > /* Use a normal loop if there are no statements that need masking. > > This only happens in rare degenerate cases: it means that the loop > > @@ -1219,6 +1203,12 @@ vect_verify_full_masking (loop_vec_info loop_vinfo) > > if (LOOP_VINFO_MASKS (loop_vinfo).is_empty ()) > > return false; > > > > + /* Calculate the maximum number of scalars per iteration for every rgroup. */ > > + unsigned int max_nscalars_per_iter = 1; > > + for (auto rgm : LOOP_VINFO_MASKS (loop_vinfo)) > > + max_nscalars_per_iter > > + = MAX (max_nscalars_per_iter, rgm.max_nscalars_per_iter); > > + > > /* Work out how many bits we need to represent the limit. */ > > min_ni_width > > = vect_min_prec_for_max_niters (loop_vinfo, max_nscalars_per_iter); > -- Richard Biener SUSE Software Solutions Germany GmbH, Frankenstrasse 146, 90461 Nuernberg, Germany; GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman; HRB 36809 (AG Nuernberg)