From patchwork Mon Mar 25 10:00:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chenghui Pan X-Patchwork-Id: 1915475 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 4V37kT6FNvz1yWy for ; Mon, 25 Mar 2024 21:01:36 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 87552385842A for ; Mon, 25 Mar 2024 10:01:34 +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 133413858404 for ; Mon, 25 Mar 2024 10:01:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 133413858404 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 133413858404 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=1711360869; cv=none; b=CmgpIfUOXIX70MU6nBQpFYtt9xECgh9ohZm7Xcqv0R6RrPcJvMvsyyMBndvUMts/p/eSyr+H/ZywnAkuLL4vz/d0YjfpfEcCVWgPD2stXAldyvzQ3vtYT56YTwP1b5zHTONYeU3TznbZMy6pUO/D+9Oeb7Stw1COXarRIvej0qs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711360869; c=relaxed/simple; bh=u3AD8aZK9KLTEReYhUtmQp4egSq5ZoeFTJKWHK/+jDo=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=RVtktHGxa5QzBKa+TSrRqKCF9wikoYzYh/grXi7KtVjpgc7/HxS+UOxsk5R/4oqwtqXins5kguqNiush9Gm/gS1wlBk1n2iHAVFsgK0iEcsR1HR1LFCe7k6lwOfYRZpzlsRdCHNOxlcwtPxAuQ3PmsynarkbuZ8I6cgXLYvbNf0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from loongson.cn (unknown [10.2.6.5]) by gateway (Coremail) with SMTP id _____8BxnutbSwFmK8sdAA--.4017S3; Mon, 25 Mar 2024 18:01:00 +0800 (CST) Received: from 5.5.5 (unknown [10.2.6.5]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dxfs1PSwFm9hhnAA--.4058S4; Mon, 25 Mar 2024 18:00:54 +0800 (CST) From: Chenghui Pan To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com, rguenther@suse.de, Chenghui Pan Subject: [PATCH v2] doc: Correction of Tree SSA Passes info. Date: Mon, 25 Mar 2024 18:00:30 +0800 Message-Id: <20240325100030.2880394-1-panchenghui@loongson.cn> X-Mailer: git-send-email 2.39.3 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dxfs1PSwFm9hhnAA--.4058S4 X-CM-SenderInfo: psdquxxhqjx33l6o00pqjv00gofq/1tbiAQAHBGYBNegAvgABsH X-Coremail-Antispam: 1Uk129KBj93XoW3Gr4kZw15ArWrAFW3AFWUtrc_yoW3ZF17pr W3Gw12vFs7JrnakrnrAw1kJ3Wxtan7JF47G3y2gF92vwn8Zr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=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. Changes since v1: Add correct info for pass_build_alias. gcc/ChangeLog: * 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