From patchwork Tue Oct 29 11:17:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 99760 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BCBB9385843B for ; Tue, 29 Oct 2024 11:18:04 +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 754C23858414 for ; Tue, 29 Oct 2024 11:17:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 754C23858414 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 754C23858414 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=1730200647; cv=none; b=sYAub+nUw+ICOA/RpH/lhiJQ0CT+v3IHt8DdsDmvHZYCJwcIP1FLRZtuckOMpF3s6Ouv5IpLUWF9WTRVT8WLo1LC4G3DTeDz98PKTat65Gday7laG4TZH4OsPdUzi2FKjc2fwg5ZspYfb6eprBpAll1e65r3S5cXfB/P+UbbPUA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730200647; c=relaxed/simple; bh=er0gQeFQFwZ4DYKJBbqIZrpDWsneWYdA3he2N9qTSZg=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:MIME-Version:Message-Id; b=FWnoAnaoTFqnIgqZLyNGbXBPgzUHNSwRidOptPKHWC01zl2RjNtCU+og+enfYY9uoGaDfP5LzO/Oj0TDVgv+J9616m4T7VXw1cqsT5crBEebvQPyniJSrBfrRrmAChWpzd+gtCT+NzacQMim6a+uPLGB/DFb3imE5oEuW2leYLs= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 F035821FA5 for ; Tue, 29 Oct 2024 11:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1730200644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Rxo0/5EPFd/uaW4+HFE89P1DKGFeCDC1qSHbyB3rmd0=; b=QGeuNo1vZoKTYMJx7kemakaMKQjSVp4LkL1H7Lt0lSX+Iq4v1LHEIdzx4uAjBm6qS+XdyC TlfAtFJv64mKoWYWl8aKr3ds6SEJfz22QiOFemMB81EaBsOOhkJpDBzyHncMpWYQnq8oWC U6/LhWXWTcLjmiAFNJrEHxJ6psQ61DA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1730200644; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Rxo0/5EPFd/uaW4+HFE89P1DKGFeCDC1qSHbyB3rmd0=; b=mNFMrjG5HzAjczUv8S4yTQGavK5HqW8i4xrvHOEf7o/2YOOiBg9azBY7WEK/45VuFHSwEB Nt3AKFUEscAJe3CQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=HpRwfIZQ; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=ZkRn5+IC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1730200643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Rxo0/5EPFd/uaW4+HFE89P1DKGFeCDC1qSHbyB3rmd0=; b=HpRwfIZQJMw1L9+U6zXIqxBeJRtkt5ChIR5m9W2EhpSIYLcBFI3W6j8xUSG/dMGCOhpwEz 8IUNOJUQqVCtaM19aygmU/vnJly5XVsy8QUewNeHrMh68UQ1zVhcALcvWfkHlZuLGQ6bsA rXVi6Ecw2eVCOOVjeBXic8T3PXDmJ7g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1730200643; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=Rxo0/5EPFd/uaW4+HFE89P1DKGFeCDC1qSHbyB3rmd0=; b=ZkRn5+ICsV9IWOH3/vtjR7CGjyizvdPtqWIxTX0KOVbvHYXtLKVWcP7EW3xSX9dJ/d8gnJ 6CLWAtkF+5Jy5GAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D6135136A5 for ; Tue, 29 Oct 2024 11:17:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id y/KPMkPEIGc/QgAAD6G6ig (envelope-from ) for ; Tue, 29 Oct 2024 11:17:23 +0000 Date: Tue, 29 Oct 2024 12:17:08 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/117343 - decide_masked_load_lanes and stale graph MIME-Version: 1.0 Message-Id: <20241029111723.D6135136A5@imap1.dmz-prg2.suse.org> X-Rspamd-Queue-Id: F035821FA5 X-Spam-Level: X-Spamd-Result: default: False [-4.51 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MISSING_XM_UA(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim]; RCVD_TLS_ALL(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[gcc-patches@gcc.gnu.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action X-Spam-Score: -4.51 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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~patchwork=sourceware.org@gcc.gnu.org It turns out decide_masked_load_lanes accesses a stale SLP graph so the following re-builds it instead. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/117343 * tree-vect-slp.cc (vect_optimize_slp_pass::build_vertices): Support re-building the SLP graph. (vect_optimize_slp_pass::run): Re-build the SLP graph before decide_masked_load_lanes. --- gcc/tree-vect-slp.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/tree-vect-slp.cc b/gcc/tree-vect-slp.cc index 2e98a943e06..a7f064bb0ed 100644 --- a/gcc/tree-vect-slp.cc +++ b/gcc/tree-vect-slp.cc @@ -5632,6 +5632,8 @@ vect_optimize_slp_pass::build_vertices () hash_set visited; unsigned i; slp_instance instance; + m_vertices.truncate (0); + m_leafs.truncate (0); FOR_EACH_VEC_ELT (m_vinfo->slp_instances, i, instance) build_vertices (visited, SLP_INSTANCE_TREE (instance)); } @@ -7244,6 +7246,8 @@ vect_optimize_slp_pass::run () } else remove_redundant_permutations (); + free_graph (m_slpg); + build_graph (); decide_masked_load_lanes (); free_graph (m_slpg); }