From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id 48CAA3858438; Fri, 23 Feb 2024 07:31:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 48CAA3858438 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708673480; bh=L3bYhmxbg8X1M2NtKX5gqkj1eEanu55wEcbs2vquclQ=; h=From:To:Subject:Date:From; b=RIiC5dhioPukq3bGKLQneKT2DZ8KaXp6Y3IVVJ+ZGgn8/Hz9uhiazkeEYVQYZ3htw JjqIZCqf7GiJljhaM9+Fl//f8GLMoKQMsDEVjZH+kaC6skZb6cKdvqrKUT09bpmDKP MNOizMTgq9/4wJzTkcc4FALsl2IBNkx8dBtZKau4= 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: 0ba91dbde1f9ccabf730327d4b9d2272ccb266ae X-Git-Newrev: 248bd7d8308449d4c40f7f49bb51f0aec03b6adb Message-Id: <20240223073120.48CAA3858438@sourceware.org> Date: Fri, 23 Feb 2024 07:31:20 +0000 (GMT) List-Id: https://gcc.gnu.org/g:248bd7d8308449d4c40f7f49bb51f0aec03b6adb commit 248bd7d8308449d4c40f7f49bb51f0aec03b6adb 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 a89836f0df35..e5a5045f4f5f 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -4322,7 +4322,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));