From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id D82C53857727; Mon, 16 Oct 2023 12:49:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D82C53857727 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1697460575; bh=uHtFlhrJgFDe1+EDFDnJI32PnlZJjT6yPl48BdcMVYk=; h=From:To:Subject:Date:From; b=F97W/l9+6l2rcy6EQiL6UTAy/a9n5zfnEjOD8RZ/vI1gwR5o85C3iyuXmBzzOpcNx QqzrlDbXlCe0FjgqnAoI3FdKKzLNgO4Ir/qIDXVdM3V1O8/QzsxgG3/7DXWAvwbE4+ 2bXzbVm44my7WXz2+3vHrEOLBwIIaYc3Duf0CcHU= 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: c34b76b91c66a993b432c107172f3217ac7d9078 X-Git-Newrev: 9552241ae15096a0fd9076b04f717bda45cc37a8 Message-Id: <20231016124935.D82C53857727@sourceware.org> Date: Mon, 16 Oct 2023 12:49:35 +0000 (GMT) List-Id: https://gcc.gnu.org/g:9552241ae15096a0fd9076b04f717bda45cc37a8 commit 9552241ae15096a0fd9076b04f717bda45cc37a8 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 4e0b0436aa31..9741d2ee2163 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -4228,7 +4228,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));