From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id A6CB03857705; Fri, 6 Oct 2023 07:07:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A6CB03857705 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696576032; bh=NjXtF3l9AwtJAQXQYSmXN9J6eLGb044jsok4Hn+ERNY=; h=From:To:Subject:Date:From; b=USOzLo5HsSC3UdTILOaU15AtcfaavLMOeUsi7vr6gghpGIFrXyOsB3iYh5pK6c6Le r1B8p1JevDoVdds0lH6x9s5dmTPbWSkT6PK0kdBmGpSM+90lWC/d7ub9g8BWQiOqAy 5oizegK5LdetjtsoS2N/tLjRgrT/UcT24dXqeGAY= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/rguenth/heads/vect-force-slp)] Do not account single-lane SLP graphs against discovery limit X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/users/rguenth/heads/vect-force-slp X-Git-Oldrev: 8520f385b0f424d66d20db40ff1bb54cec063802 X-Git-Newrev: d2799c4ffdb8b99ce8dd1502b2a5dfd2d7f33933 Message-Id: <20231006070712.A6CB03857705@sourceware.org> Date: Fri, 6 Oct 2023 07:07:12 +0000 (GMT) List-Id: https://gcc.gnu.org/g:d2799c4ffdb8b99ce8dd1502b2a5dfd2d7f33933 commit d2799c4ffdb8b99ce8dd1502b2a5dfd2d7f33933 Author: Richard Biener Date: Fri Sep 29 15:12:54 2023 +0200 Do not account single-lane SLP graphs against discovery limit The following avoids accounting single-lane SLP to the discovery limit. Even when raising it the attempt of forming multi-lane SLP can exhaust the limit before we fall back to single-lane. * tree-vect-slp.cc (vect_build_slp_tree): Only account multi-lane SLP to limit. Diff: --- gcc/tree-vect-slp.cc | 31 ++++++++++++++++++------------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 4646380232f..41b5626cbe5 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1634,21 +1634,26 @@ vect_build_slp_tree (vec_info *vinfo, SLP_TREE_SCALAR_STMTS (res) = stmts; bst_map->put (stmts.copy (), res); - if (*limit == 0) + /* Single-lane SLP doesn't have the chance of run-away, do not account + it to the limit. */ + if (stmts.length () > 1) { - if (dump_enabled_p ()) - dump_printf_loc (MSG_NOTE, vect_location, - "SLP discovery limit exceeded\n"); - /* Mark the node invalid so we can detect those when still in use - as backedge destinations. */ - SLP_TREE_SCALAR_STMTS (res) = vNULL; - SLP_TREE_DEF_TYPE (res) = vect_uninitialized_def; - res->failed = XNEWVEC (bool, group_size); - memset (res->failed, 0, sizeof (bool) * group_size); - memset (matches, 0, sizeof (bool) * group_size); - return NULL; + if (*limit == 0) + { + if (dump_enabled_p ()) + dump_printf_loc (MSG_NOTE, vect_location, + "SLP discovery limit exceeded\n"); + /* Mark the node invalid so we can detect those when still in use + as backedge destinations. */ + SLP_TREE_SCALAR_STMTS (res) = vNULL; + SLP_TREE_DEF_TYPE (res) = vect_uninitialized_def; + res->failed = XNEWVEC (bool, group_size); + memset (res->failed, 0, sizeof (bool) * group_size); + memset (matches, 0, sizeof (bool) * group_size); + return NULL; + } + --*limit; } - --*limit; if (dump_enabled_p ()) dump_printf_loc (MSG_NOTE, vect_location,