From patchwork Mon Mar 25 03:45:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenghui Pan X-Patchwork-Id: 1915402 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; 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 [IPv6:2620:52:3:1:0:246e:9693:128c]) (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 4V2zPx1FTSz1yXy for ; Mon, 25 Mar 2024 14:46:43 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 41B1B3858429 for ; Mon, 25 Mar 2024 03:46:41 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id BBB803858404 for ; Mon, 25 Mar 2024 03:46:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BBB803858404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BBB803858404 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=114.242.206.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711338384; cv=none; b=CJwDK0tqN726ZDrSv/BiY+xJyfEv11RDerwzwlBu3tbi7iPmWL3ymXQNSDIcDmF8F4WZjGHH7FzjvejhPiFIYZvKTbe5kmeiJaPBmwipk6N+A4KblwQCmio/u25MQJxdDmSu0+jQlTOuMvdve7ztfyyl2dZ45nZOAy+ZjnRKZfk= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711338384; c=relaxed/simple; bh=+CLndJEilI6S2gG9R3e/2bnjCkzsMEzral1ibOq2AZ4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=SBcqKb5KESCJCbmH9egaYyiG3afuA5wgAUeY0bmh8TIa8OeGW1qaiGHRY8e743xuc3SV0KTtcrKP0vQwwOYp6hQDpN9PhiXj5FtiCnrxn0odfoHs0+/4Anzn0JW9EDhBroyqsnNMplYLRTyVzsDZovjNKNUzIZ1MDm9xgg1TCRI= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.2.6.5]) by gateway (Coremail) with SMTP id _____8BxC+mF8wBm+pIdAA--.49718S3; Mon, 25 Mar 2024 11:46:13 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxZMx48wBmJpJmAA--.11261S4; Mon, 25 Mar 2024 11:46:07 +0800 (CST) From: Chenghui Pan To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, jakub@redhat.com, Chenghui Pan Subject: [PATCH v1] doc: Correction of Tree SSA Passes info. Date: Mon, 25 Mar 2024 11:45:47 +0800 Message-Id: <20240325034547.376836-1-panchenghui@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxZMx48wBmJpJmAA--.11261S4 X-CM-SenderInfo: psdquxxhqjx33l6o00pqjv00gofq/1tbiAQAHBGX-5GgETgAAse X-Coremail-Antispam: 1Uk129KBj93XoW3Gr4kZw15KF1Duw1DuF45Arc_yoW3Ar13pr W3Gw12yFs7JrnakrnrAw1kJ3Wxta1xJF47G3yYgF92vwn8Zr4Ivr1akw1YvrWxGrW8Zr1Y qryYq34DJrn8uagCm3ZEXasCq-sJn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Pc02F40EFcxC0VAKzVAqx4xG6I80ewCIccxYrVCIc48FwI0_Xr0_ArUv 73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUYI7kC6x804xWl14x267AKxVWUJVW8Jw AFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26r1j6r1xM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r1j6r4UM28EF7xvwVC2z280aVAFwI0_Cr0_Gr1UM28E F7xvwVC2z280aVCY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57 IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE 14v26r1j6r18McIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2 IYc2Ij64vIr41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAq x4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r 1DMIIYY7kG6IIYr7AKxVW5JVW7JwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j 6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_Jr 0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAIcVC2z280aVCY1x0267AKxVWUJVW8JbIY CTnIWIevJa73UjIFyTuYvjxU7ksgUUUUU X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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 Current document of Tree SSA passes contains many parts that is not updated for many years. This patch removes some info that is outdated and not existed in current GCC codebase, and fixes some wrong code location descriptions based on current codebase status and ChangeLogs. gcc/ChangeLog: * doc/passes.texi: Correction of Tree SSA Passes info. --- gcc/doc/passes.texi | 70 ++++----------------------------------------- 1 file changed, 6 insertions(+), 64 deletions(-) diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi index b50d3d5635b..068036acb7d 100644 --- a/gcc/doc/passes.texi +++ b/gcc/doc/passes.texi @@ -450,17 +450,6 @@ The following briefly describes the Tree optimization passes that are run after gimplification and what source files they are located in. @itemize @bullet -@item Remove useless statements - -This pass is an extremely simple sweep across the gimple code in which -we identify obviously dead code and remove it. Here we do things like -simplify @code{if} statements with constant conditions, remove -exception handling constructs surrounding code that obviously cannot -throw, remove lexical bindings that contain no variables, and other -assorted simplistic cleanups. The idea is to get rid of the obvious -stuff quickly rather than wait until later when it's more work to get -rid of it. This pass is located in @file{tree-cfg.cc} and described by -@code{pass_remove_useless_stmts}. @item OpenMP lowering @@ -478,7 +467,7 @@ described by @code{pass_lower_omp}. If OpenMP generation (@option{-fopenmp}) is enabled, this pass expands parallel regions into their own functions to be invoked by the thread -library. The pass is located in @file{omp-low.cc} and is described by +library. The pass is located in @file{omp-expand.cc} and is described by @code{pass_expand_omp}. @item Lower control flow @@ -511,15 +500,6 @@ This pass decomposes a function into basic blocks and creates all of the edges that connect them. It is located in @file{tree-cfg.cc} and is described by @code{pass_build_cfg}. -@item Find all referenced variables - -This pass walks the entire function and collects an array of all -variables referenced in the function, @code{referenced_vars}. The -index at which a variable is found in the array is used as a UID -for the variable within this function. This data is needed by the -SSA rewriting routines. The pass is located in @file{tree-dfa.cc} -and is described by @code{pass_referenced_vars}. - @item Enter static single assignment form This pass rewrites the function such that it is in SSA form. After @@ -562,15 +542,6 @@ variables that are used once into the expression that uses them and seeing if the result can be simplified. It is located in @file{tree-ssa-forwprop.cc} and is described by @code{pass_forwprop}. -@item Copy Renaming - -This pass attempts to change the name of compiler temporaries involved in -copy operations such that SSA->normal can coalesce the copy away. When compiler -temporaries are copies of user variables, it also renames the compiler -temporary to the user variable resulting in better use of user symbols. It is -located in @file{tree-ssa-copyrename.c} and is described by -@code{pass_copyrename}. - @item PHI node optimizations This pass recognizes forms of PHI inputs that can be represented as @@ -585,8 +556,7 @@ The resulting may-alias, must-alias, and escape analysis information is used to promote variables from in-memory addressable objects to non-aliased variables that can be renamed into SSA form. We also update the @code{VDEF}/@code{VUSE} memory tags for non-renameable -aggregates so that we get fewer false kills. The pass is located -in @file{tree-ssa-alias.cc} and is described by @code{pass_may_alias}. +aggregates so that we get fewer false kills. Interprocedural points-to information is located in @file{tree-ssa-structalias.cc} and described by @code{pass_ipa_pta}. @@ -604,7 +574,7 @@ is described by @code{pass_ipa_tree_profile}. This pass implements series of heuristics to guess propababilities of branches. The resulting predictions are turned into edge profile by propagating branches across the control flow graphs. -The pass is located in @file{tree-profile.cc} and is described by +The pass is located in @file{predict.cc} and is described by @code{pass_profile}. @item Lower complex arithmetic @@ -653,7 +623,7 @@ in @file{tree-ssa-math-opts.cc} and is described by @item Full redundancy elimination This is a simpler form of PRE that only eliminates redundancies that -occur on all paths. It is located in @file{tree-ssa-pre.cc} and +occur on all paths. It is located in @file{tree-ssa-sccvn.cc} and described by @code{pass_fre}. @item Loop optimization @@ -708,7 +678,7 @@ to align the number of iterations, and to align the memory accesses in the loop. The pass is implemented in @file{tree-vectorizer.cc} (the main driver), @file{tree-vect-loop.cc} and @file{tree-vect-loop-manip.cc} (loop specific parts -and general loop utilities), @file{tree-vect-slp} (loop-aware SLP +and general loop utilities), @file{tree-vect-slp.cc} (loop-aware SLP functionality), @file{tree-vect-stmts.cc}, @file{tree-vect-data-refs.cc} and @file{tree-vect-slp-patterns.cc} containing the SLP pattern matcher. Analysis of data references is in @file{tree-data-ref.cc}. @@ -755,10 +725,6 @@ the ``copy-of'' relation. It eliminates redundant copies from the code. The pass is located in @file{tree-ssa-copy.cc} and described by @code{pass_copy_prop}. -A related pass that works on memory copies, and not just register -copies, is located in @file{tree-ssa-copy.cc} and described by -@code{pass_store_copy_prop}. - @item Value range propagation This transformation is similar to constant propagation but @@ -811,14 +777,6 @@ run last so that we have as much time as possible to prove that the statement is not reachable. It is located in @file{tree-cfg.cc} and is described by @code{pass_warn_function_return}. -@item Leave static single assignment form - -This pass rewrites the function such that it is in normal form. At -the same time, we eliminate as many single-use temporaries as possible, -so the intermediate language is no longer GIMPLE, but GENERIC@. The -pass is located in @file{tree-outof-ssa.cc} and is described by -@code{pass_del_ssa}. - @item Merge PHI nodes that feed into one another This is part of the CFG cleanup passes. It attempts to join PHI nodes @@ -857,25 +815,9 @@ pass is located in @file{tree-object-size.cc} and is described by @item Loop invariant motion This pass removes expensive loop-invariant computations out of loops. -The pass is located in @file{tree-ssa-loop.cc} and described by +The pass is located in @file{tree-ssa-loop-im.cc} and described by @code{pass_lim}. -@item Loop nest optimizations - -This is a family of loop transformations that works on loop nests. It -includes loop interchange, scaling, skewing and reversal and they are -all geared to the optimization of data locality in array traversals -and the removal of dependencies that hamper optimizations such as loop -parallelization and vectorization. The pass is located in -@file{tree-loop-linear.c} and described by -@code{pass_linear_transform}. - -@item Removal of empty loops - -This pass removes loops with no code in them. The pass is located in -@file{tree-ssa-loop-ivcanon.cc} and described by -@code{pass_empty_loop}. - @item Unrolling of small loops This pass completely unrolls loops with few iterations. The pass