From patchwork Fri Jun 28 11:47:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1953900 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sI3LxSXB; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ji6ZGhTu; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=sI3LxSXB; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=ji6ZGhTu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W9Ybk65Q8z20Zy for ; Fri, 28 Jun 2024 21:48:18 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B3691382DB1E for ; Fri, 28 Jun 2024 11:48:14 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 4656E382FADF for ; Fri, 28 Jun 2024 11:47:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4656E382FADF Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4656E382FADF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719575276; cv=none; b=N33tN4KuZ6zFCKG7qrSG8Nj4n4iOS2C08GTf1iDhsLAZ1dCJ/FJi1vdjbDagGSW6yKirynm9nmXA9BONEwSo0SjEm4Kvn+7VUHeMni2C9dfiXU0q1geVUDr6Dv7TzG4eD9NFSW20dtFR4/sWvHIhELdZXyp7Lz07oIhj5mDIFmc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1719575276; c=relaxed/simple; bh=aS0znH2jJ4U0LqR7CXoLzvgT3HwoO0qtzRDpRTS4Xbg=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version; b=DRHTv/r7m+VpVwYFm7rfkqVbYT/zTeeuCQcsohtm0tyMB8uy6v4KjLQE1Pat8hsMMvLGHSCnVSMUaAPCXFqWeqpEQHW0jNUYaUPQbPHzi8jQ9SXAs/QDlhNQb5PdDc1jdR58KT3uBLMUJBu+ZBgevSAnDYvkny65kuPhEGVggJg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from murzim.nue2.suse.org (unknown [10.168.4.243]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C4C0E21BC1 for ; Fri, 28 Jun 2024 11:47:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1719575271; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=9gCMFuuRWD91a375MNWz+dceoDzI9FRmCMWYXZcRzlU=; b=sI3LxSXBgMe5XE35uiNDGraFF8ClsKynwDoVYjWkSX9b/AMTYLksue8PrHRLzH49nlj+en ZkBbeFIzfrE2c0cxUKyk9j+PzlqxxCIAmImHQEVAPCC3C2KmFzRersbS5jUke0H7eVcSLC /U35qQ/ya58bkawu6ViaHnFKg1XfiCo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1719575271; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=9gCMFuuRWD91a375MNWz+dceoDzI9FRmCMWYXZcRzlU=; b=ji6ZGhTu6K1YRAg+quvjNel6ASmgXu4jFAHhSff857zjJI/9HUcho5CecY7BAdPPYfWNFH 9PX2kptOf4ZqrvCg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1719575271; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=9gCMFuuRWD91a375MNWz+dceoDzI9FRmCMWYXZcRzlU=; b=sI3LxSXBgMe5XE35uiNDGraFF8ClsKynwDoVYjWkSX9b/AMTYLksue8PrHRLzH49nlj+en ZkBbeFIzfrE2c0cxUKyk9j+PzlqxxCIAmImHQEVAPCC3C2KmFzRersbS5jUke0H7eVcSLC /U35qQ/ya58bkawu6ViaHnFKg1XfiCo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1719575271; h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version: content-type:content-type; bh=9gCMFuuRWD91a375MNWz+dceoDzI9FRmCMWYXZcRzlU=; b=ji6ZGhTu6K1YRAg+quvjNel6ASmgXu4jFAHhSff857zjJI/9HUcho5CecY7BAdPPYfWNFH 9PX2kptOf4ZqrvCg== Date: Fri, 28 Jun 2024 13:47:51 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/115652 - more fixing of the fix MIME-Version: 1.0 X-Spamd-Result: default: False [-1.64 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-0.94)[-0.941]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_SHORT(-0.10)[-0.488]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_ZERO(0.00)[0]; MISSING_XM_UA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; MIME_TRACE(0.00)[0:+] X-Spam-Score: -1.64 X-Spam-Level: X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Message-Id: <20240628114814.B3691382DB1E@sourceware.org> The following addresses the corner case of an outer loop with an empty header where we end up asking for the BB of a NULL stmt by special-casing this case. Bootstrap and regtest running on x86_64-unknown-linux-gnu, the patch fixes observed ICEs on GCN. PR tree-optimization/115652 * tree-vect-slp.cc (vect_schedule_slp_node): Handle the case where the outer loop header block is empty. --- gcc/tree-vect-slp.cc | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 174b4800fa9..dd9017e5b3a 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -9750,8 +9750,15 @@ vect_schedule_slp_node (vec_info *vinfo, { gimple_stmt_iterator si2 = gsi_after_labels (LOOP_VINFO_LOOP (loop_vinfo)->header); - if (last_stmt != *si2 - && vect_stmt_dominates_stmt_p (last_stmt, *si2)) + if ((gsi_end_p (si2) + && (LOOP_VINFO_LOOP (loop_vinfo)->header + != gimple_bb (last_stmt)) + && dominated_by_p (CDI_DOMINATORS, + LOOP_VINFO_LOOP (loop_vinfo)->header, + gimple_bb (last_stmt))) + || (!gsi_end_p (si2) + && last_stmt != *si2 + && vect_stmt_dominates_stmt_p (last_stmt, *si2))) si = si2; } }