From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 0A3C13858C35; Mon, 16 Oct 2023 12:49:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A3C13858C35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697460586; bh=xMyd52ICj7CZYJPCsoKbLrx/wxyVW6suZjhbVeWENgs=; h=From:To:Subject:Date:From; b=Ne9fXJp4Rl4k/JJYhW7Rpa19V96ynfaBiLyK2eSi+RIyBt3Pt/1Ga9A93XHH+45is e1ant1EcIYy4Sn8aRznDQ3Kv4DjA05eSOoO1uwkVYKCvj39hEC5Hb3G16XxInYDtp2 Ee+JEos+DzbeR8DyR+QY26QfKBcPWd6UXd9HHhMU= 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: 64a5842cd8c64508c96e33d9f97118d64e096740 X-Git-Newrev: 5515521aa666f94a430974be7b0f8dcb5c5dc583 Message-Id: <20231016124946.0A3C13858C35@sourceware.org> Date: Mon, 16 Oct 2023 12:49:46 +0000 (GMT) List-Id: https://gcc.gnu.org/g:5515521aa666f94a430974be7b0f8dcb5c5dc583 commit 5515521aa666f94a430974be7b0f8dcb5c5dc583 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 9741d2ee2163..ef3a105cfaf4 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -1652,21 +1652,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,