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 2B0223858422 for ; Wed, 14 Jun 2023 11:47:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2B0223858422 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 333451FDE8; Wed, 14 Jun 2023 11:47:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1686743230; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=18sNdXDeUxwAP1F9Gmn4qTlEINzVo5+NvXNQlJP4xzE=; b=t/gXlTAg5tmJNkE+oTSq3vOFomYyGhYKkLrDo2jBP3ggILWMweK75Rj2XMtPbKuZA+0nDe 2ANQsa34I91NTNFdbzYXH81oiK+HVE1+vZGYuztQagk6vEeVCZafC4HECVt7/x3ml7Amoq C6E+7jSckRJwvsP3REQRhCAKCoFvSf0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1686743230; h=from:from:reply-to:date:date:to:to:cc:cc:mime-version:mime-version: content-type:content-type; bh=18sNdXDeUxwAP1F9Gmn4qTlEINzVo5+NvXNQlJP4xzE=; b=7d0K2CjV/I5hxSpBXGbLm5WyyBAlxQwoM7h4qNLtIUKne9uhOOc8m97shuJRhNjNyZ/zWm 48tt0hdLE35qBuBw== 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 21B9F2C141; Wed, 14 Jun 2023 11:47:10 +0000 (UTC) Date: Wed, 14 Jun 2023 11:47:10 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org cc: richard.sandiford@arm.com Subject: [PATCH 1/3] Inline vect_get_max_nscalars_per_iter 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.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,MISSING_MID,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: Message-ID: <20230614114710.ong9fkiihdrznOlbW1mkA-BxQ4aYBY0DXKtmx1KafcI@z> 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. --- 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); -- 2.35.3