From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id A8C043858431; Thu, 19 Oct 2023 13:28:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A8C043858431 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697722136; bh=yTXV7UsX6xqbcncQy7tcpa2n0TsFKfmHC8rWNx2kKFM=; h=From:To:Subject:Date:From; b=MlWSIukIxj3Wu3uTu56cUtAlC03HwTUqyN0iTP7NXgswwW+LdcoL6/ygwmnjexEZc XgMVZ1UpehjbhcueZpLk+oPfPTPtoYADKiBREfJIFxxGWTPCMn6DB173s5isMR/HZa yk+Ujwl6OvCAzSQefAYZhTilC0hmT5NtQdzWB+MI= 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)] Guard SLP optimize latch edge discovery X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/users/rguenth/heads/vect-force-slp X-Git-Oldrev: 035bd67583014c17dcc99c23b294caf7c5c7f1cd X-Git-Newrev: b348c0c3fd7edaa70e09eef193105165f7313e1b Message-Id: <20231019132856.A8C043858431@sourceware.org> Date: Thu, 19 Oct 2023 13:28:56 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b348c0c3fd7edaa70e09eef193105165f7313e1b commit b348c0c3fd7edaa70e09eef193105165f7313e1b Author: Richard Biener Date: Fri Sep 29 12:57:59 2023 +0200 Guard SLP optimize latch edge discovery When inserting additional VEC_PERM nodes it seems we can run is_cfg_latch_edge but given there's eventually no representative we should avoid ICEing on it. * tree-vect-slp.cc (vect_optimize_slp_pass::is_cfg_latch_edge): VER_PERM node use is never the destination of a latch. Diff: --- gcc/tree-vect-slp.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 76d023fd38b4..98170bef47ba 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -4269,7 +4269,8 @@ vect_optimize_slp_pass::is_cfg_latch_edge (graph_edge *ud) slp_tree use = m_vertices[ud->src].node; slp_tree def = m_vertices[ud->dest].node; if (SLP_TREE_DEF_TYPE (use) != vect_internal_def - || SLP_TREE_DEF_TYPE (def) != vect_internal_def) + || SLP_TREE_DEF_TYPE (def) != vect_internal_def + || SLP_TREE_CODE (use) == VEC_PERM_EXPR) return false; stmt_vec_info use_rep = vect_orig_stmt (SLP_TREE_REPRESENTATIVE (use));