From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 7FEC33858292; Fri, 23 Feb 2024 07:31:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7FEC33858292 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708673490; bh=Azu9nOABpCYsXGG3Lllhik6EaxM0OLySsJvf8daEpZM=; h=From:To:Subject:Date:From; b=DhWYYXYm0IJk1MaQ04D2HiK2QKR8ybvHwcZP5aZXjqrl1Q9U+N9wQu0if3YsvzF5f eJeDA1ydQ1fQtKDQ0Jinp/gpV/tiM1zS3FqlkSIkMPSsUEhBaMJboBL5uzmSWUthQi E3IjyrZAL5S8skKbc9Xi0XdbfnB49n4UAIUNEEeQ= 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: 305009b272b20c08eff8573445ccf70198170def X-Git-Newrev: 9db05737e95c245145155a2f1744d2c5cc2c7d33 Message-Id: <20240223073130.7FEC33858292@sourceware.org> Date: Fri, 23 Feb 2024 07:31:30 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9db05737e95c245145155a2f1744d2c5cc2c7d33 commit 9db05737e95c245145155a2f1744d2c5cc2c7d33 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 e5a5045f4f5f..47149df6cd71 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1719,21 +1719,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,