From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 5EAAF3856DD1 for ; Tue, 2 Aug 2022 06:40:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5EAAF3856DD1 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 52DFE1FEB1 for ; Tue, 2 Aug 2022 06:40:20 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 4DA682C141 for ; Tue, 2 Aug 2022 06:40:20 +0000 (UTC) Date: Tue, 2 Aug 2022 06:40:20 +0000 (UTC) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/106498 - reduce SSA updates in autopar User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-10.6 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.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Aug 2022 06:40:22 -0000 Message-ID: <20220802064020.o1QxBnN2fo4zzvUc56tmu_CmIO77I-PUfwXwKPbjBwM@z> The following reduces the number of SSA updates done during autopar OMP expansion, specifically avoiding the cases that just add virtual operands (where maybe none have been before) in dead regions of the CFG. Instead virtual SSA update is delayed until after the pass. There's much more TLC needed here, but test coverage makes it really difficult. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. PR tree-optimization/106498 * omp-expand.cc (expand_omp_taskreg): Do not perform virtual SSA update here. (expand_omp_for): Or here. (execute_expand_omp): Instead schedule it here together with CFG cleanup via TODO. --- gcc/omp-expand.cc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/gcc/omp-expand.cc b/gcc/omp-expand.cc index 936adff7f45..64e6308fc7b 100644 --- a/gcc/omp-expand.cc +++ b/gcc/omp-expand.cc @@ -1530,8 +1530,6 @@ expand_omp_taskreg (struct omp_region *region) expand_teams_call (new_bb, as_a (entry_stmt)); else expand_task_call (region, new_bb, as_a (entry_stmt)); - if (gimple_in_ssa_p (cfun)) - update_ssa (TODO_update_ssa_only_virtuals); } /* Information about members of an OpenACC collapsed loop nest. */ @@ -8191,9 +8189,6 @@ expand_omp_for (struct omp_region *region, gimple *inner_stmt) (enum built_in_function) next_ix, sched_arg, inner_stmt); } - - if (gimple_in_ssa_p (cfun)) - update_ssa (TODO_update_ssa_only_virtuals); } /* Expand code for an OpenMP sections directive. In pseudo code, we generate @@ -10591,13 +10586,10 @@ execute_expand_omp (void) expand_omp (root_omp_region); - if (flag_checking && !loops_state_satisfies_p (LOOPS_NEED_FIXUP)) - verify_loop_structure (); - cleanup_tree_cfg (); - omp_free_regions (); - return 0; + return (TODO_cleanup_cfg + | (gimple_in_ssa_p (cfun) ? TODO_update_ssa_only_virtuals : 0)); } /* OMP expansion -- the default pass, run before creation of SSA form. */ -- 2.35.3