From patchwork Tue Mar 26 01:54:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenghui Pan X-Patchwork-Id: 87646 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 E677C3858C56 for ; Tue, 26 Mar 2024 01:55:49 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 485B83858D38 for ; Tue, 26 Mar 2024 01:55:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 485B83858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=loongson.cn ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 485B83858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711418119; cv=none; b=AtyPr80HyA2tvlFsGgBwce/2DjWvHwSJ9RJ9PUgY7C5uA6Gn6pMGbcv5/dnmygiPeQYOojcqcgp5unMzoZgPsASjxdqz3dYymfT+YeaSyk8cA3d3xPMIRxuM2aauPdgArnTWLGJBl/cQ7qPxAlwJdzu28T9ROkxgfmNgLk5XL4w= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711418119; c=relaxed/simple; bh=JeGNnN9ktHikdggcQ5MyKrvpUt/Pn4Tt+FlJEgf8Gvk=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=S+qMF5UIPa3EdCIv7N2em8vbFHNCaGFjYaW4OQzqMdYU8Jekj7k9Hm5k3DqkEZ2EVlGeKdOqCM8jM7EtgGnHBEMst6KHB6n1DSfbM0vK8jyKKdAZVfQS7wdJYH/uailYqz5Iyeq2iynn5WtkKb/XnAlAjOnG7DZMkNPxygStNvw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1row1x-0005JU-AE for gcc-patches@gcc.gnu.org; Mon, 25 Mar 2024 21:55:15 -0400 Received: from loongson.cn (unknown [10.2.6.5]) by gateway (Coremail) with SMTP id _____8DxJ+jyKgJmXDQeAA--.50961S3; Tue, 26 Mar 2024 09:54:59 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxDc_rKgJmTUZoAA--.9118S4; Tue, 26 Mar 2024 09:54:52 +0800 (CST) From: Chenghui Pan To: gcc-patches@gcc.gnu.org Cc: rguenther@suse.de, jakub@redhat.com, pinskia@gmail.com, Chenghui Pan Subject: [PATCH v3] doc: Correction of Tree SSA Passes info. Date: Tue, 26 Mar 2024 09:54:26 +0800 Message-Id: <20240326015426.529229-1-panchenghui@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxDc_rKgJmTUZoAA--.9118S4 X-CM-SenderInfo: psdquxxhqjx33l6o00pqjv00gofq/1tbiAQAIBGYBNegGrgACsd X-Coremail-Antispam: 1Uk129KBj93XoW3Gr4kZFW7WF4kGF4DCFWxGrX_yoW3ury7pr W3Gw12yFs7JrnIkrnrAw1kJ3Wxtan7JF47G3y2gF92vwn8Zr4Ivr1akw1YvrWxCrW8Zr1a qryYq34DJrn8uagCm3ZEXasCq-sJn29KB7ZKAUJUUUU5529EdanIXcx71UUUUU7KY7ZEXa sCq-sGcSsGvfJ3Pc02F40EFcxC0VAKzVAqx4xG6I80ewCIccxYrVCIc48FwI0_Xr0_ArUv 73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY47kC6x804xWl14x267AKxVWUJVW8Jw AFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wAFIxvE14AKwVWUJVWUGwA2ocxC64kI II0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26r1I6r4UM28EF7 xvwVC0I7IYx2IY6xkF7I0E14v26r1j6r4UM28EF7xvwVC2z280aVAFwI0_Gr0_Cr1l84AC jcxK6I8E87Iv6xkF7I0E14v26r4j6r4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc804V CY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AK xVWUXVWUAwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48Icx kI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8C rVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtw CIccxYrVCIc48FwI0_Xr0_Ar1lIxkGc2Ij64vIr41lIxAIcVC0I7IYx2IY67AKxVWUJVWU CwCI42IY6xIIjxv20xvEc7CjxVAFwI0_Jr0_Gr1lIxAIcVCF04k26cxKx2IYs7xG6r1j6r 1xMIIF0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsG vfC2KfnxnUUI43ZEXa7IU81SoJUUUUU== Received-SPF: pass client-ip=114.242.206.163; envelope-from=panchenghui@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_FAIL, SPF_HELO_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 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. Changes since v1: * v3: Add reference to related PRs. * v2: Add correct info for pass_build_alias. gcc/ChangeLog: PR rtl-optimization/951 PR tree-optimization/13756 * doc/passes.texi: Correction of Tree SSA Passes info. --- gcc/doc/passes.texi | 75 +++++---------------------------------------- 1 file changed, 7 insertions(+), 68 deletions(-) diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi index b50d3d5635b..b13ad06c5a9 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 @@ -581,12 +552,8 @@ It is located in @file{tree-ssa-phiopt.cc} and is described by @item May-alias optimization This pass performs a flow sensitive SSA-based points-to analysis. -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}. +It is located in @file{tree-ssa-structalias.cc} and is described +by @code{pass_build_alias}. Interprocedural points-to information is located in @file{tree-ssa-structalias.cc} and described by @code{pass_ipa_pta}. @@ -604,7 +571,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 +620,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 +675,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 +722,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 +774,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 +812,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