aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorDiego Novillo <dnovillo@redhat.com>2006-05-29 14:57:39 +0000
committerDiego Novillo <dnovillo@gcc.gnu.org>2006-05-29 10:57:39 -0400
commita6719dc6addf2b923528ce710f21a8a94ace5b10 (patch)
treef21e8dd04440f47bab10536a61a2b14ddefbf586 /gcc/doc
parent6614f9f559f734f3be5d10eb7a06791ec7a908a4 (diff)
downloadgcc-a6719dc6addf2b923528ce710f21a8a94ace5b10.zip
gcc-a6719dc6addf2b923528ce710f21a8a94ace5b10.tar.gz
gcc-a6719dc6addf2b923528ce710f21a8a94ace5b10.tar.bz2
re PR tree-optimization/26242 (VRP is not documented in passes.texi)
PR 26242 * doc/passes.texi: Add documentation for pass_vrp, pass_ipa_pta, pass_fre, pass_store_ccp, pass_copy_prop, pass_store_copy_prop, pass_merge_phi, pass_nrv, pass_return_slot, pass_object_size, pass_lim, pass_linear_transform, pass_empty_loop, pass_complete_unroll, pass_loop_prefetch and pass_stdarg. From-SVN: r114200
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/passes.texi150
1 files changed, 135 insertions, 15 deletions
diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi
index 441a903..9da9191 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -265,7 +265,7 @@ and is described by @code{pass_referenced_vars}.
This pass rewrites the function such that it is in SSA form. After
this pass, all @code{is_gimple_reg} variables will be referenced by
@code{SSA_NAME}, and all occurrences of other variables will be
-annotated with @code{VDEFS} and @code{VUSES}; phi nodes will have
+annotated with @code{VDEFS} and @code{VUSES}; PHI nodes will have
been inserted as necessary for each basic block. This pass is
located in @file{tree-ssa.c} and is described by @code{pass_build_ssa}.
@@ -295,9 +295,9 @@ expression simplification, and jump threading. It is run multiple times
throughout the optimization process. It it located in @file{tree-ssa-dom.c}
and is described by @code{pass_dominator}.
-@item Redundant phi elimination
+@item Redundant PHI elimination
-This pass removes phi nodes for which all of the arguments are the same
+This pass removes PHI nodes for which all of the arguments are the same
value, excluding feedback. Such degenerate forms are typically created
by removing unreachable code. The pass is run multiple times throughout
the optimization process. It is located in @file{tree-ssa.c} and is
@@ -321,7 +321,7 @@ located in @file{tree-ssa-copyrename.c} and is described by
@item PHI node optimizations
-This pass recognizes forms of phi inputs that can be represented as
+This pass recognizes forms of PHI inputs that can be represented as
conditional expressions and rewrites them into straight line code.
It is located in @file{tree-ssa-phiopt.c} and is described by
@code{pass_phiopt}.
@@ -336,6 +336,9 @@ update the @code{VDEF}/@code{VUSE} memory tags for non-renamable
aggregates so that we get fewer false kills. The pass is located
in @file{tree-ssa-alias.c} and is described by @code{pass_may_alias}.
+Interprocedural points-to information is located in
+@file{tree-ssa-structalias.c} and described by @code{pass_ipa_pta}.
+
@item Profiling
This pass rewrites the function in order to collect runtime block
@@ -387,6 +390,12 @@ divisions to multiplications by the reciprocal. The pass is located
in @file{tree-ssa-math-opts.c} and is described by
@code{pass_cse_reciprocal}.
+@item Full redundancy elimination
+
+This is a simpler form of PRE that only eliminate redundancies that
+occur an all paths. It is located in @file{tree-ssa-pre.c} and
+described by @code{pass_fre}.
+
@item Loop optimization
The main driver of the pass is placed in @file{tree-ssa-loop.c}
@@ -440,11 +449,12 @@ Analysis of data references is in @file{tree-data-ref.c}.
@item Tree level if-conversion for vectorizer
This pass applies if-conversion to simple loops to help vectorizer.
-We identify if convertable loops, if-convert statements and merge
+We identify if convertible loops, if-convert statements and merge
basic blocks in one big block. The idea is to present loop in such
form so that vectorizer can have one to one mapping between statements
and available vector operations. This patch re-introduces COND_EXPR
-at GIMPLE level. This pass is located in @file{tree-if-conv.c}.
+at GIMPLE level. This pass is located in @file{tree-if-conv.c} and is
+described by @code{pass_if_conversion}.
@item Conditional constant propagation
@@ -453,9 +463,38 @@ that must be constant even in the presence of conditional branches.
The pass is located in @file{tree-ssa-ccp.c} and is described
by @code{pass_ccp}.
-@item Folding builtin functions
+A related pass that works on memory loads and stores, and not just
+register values, is located in @file{tree-ssa-ccp.c} and described by
+@code{pass_store_ccp}.
+
+@item Conditional copy propagation
+
+This is similar to constant propagation but the lattice of values is
+the ``copy-of'' relation. It eliminates redundant copies from the
+code. The pass is located in @file{tree-ssa-copy.c} 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.c} and described by
+@code{pass_store_copy_prop}.
+
+@item Value range propagation
+
+This transformation is similar to constant propagation but
+instead of propagating single constant values, it propagates
+known value ranges. The implementation is based on Patterson's
+range propagation algorithm (Accurate Static Branch Prediction by
+Value Range Propagation, J. R. C. Patterson, PLDI '95). In
+contrast to Patterson's algorithm, this implementation does not
+propagate branch probabilities nor it uses more than a single
+range per SSA name. This means that the current implementation
+cannot be used for branch prediction (though adapting it would
+not be difficult). The pass is located in @file{tree-vrp.c} and is
+described by @code{pass_vrp}.
+
+@item Folding built-in functions
-This pass simplifies builtin functions, as applicable, with constant
+This pass simplifies built-in functions, as applicable, with constant
arguments or with inferrable string lengths. It is located in
@file{tree-ssa-ccp.c} and is described by @code{pass_fold_builtins}.
@@ -465,12 +504,6 @@ This pass identifies critical edges and inserts empty basic blocks
such that the edge is no longer critical. The pass is located in
@file{tree-cfg.c} and is described by @code{pass_split_crit_edges}.
-@item Partial redundancy elimination
-
-This pass answers the question ``given a hypothetical temporary
-variable, what expressions could we eliminate?'' It is located
-in @file{tree-ssa-pre.c} and is described by @code{pass_pre}.
-
@item Control dependence dead code elimination
This pass is a stronger form of dead code elimination that can
@@ -514,7 +547,94 @@ is described by @code{pass_mudflap_2}.
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-ssa.c} and is described by @code{pass_del_ssa}.
+pass is located in @file{tree-outof-ssa.c} 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
+from a forwarder CFG block into another block with PHI nodes. The
+pass is located in @file{tree-cfgcleanup.c} and is described by
+@code{pass_merge_phi}.
+
+@item Return value optimization
+
+If a function always returns the same local variable, and that local
+variable is an aggregate type, then the variable is replaced with the
+return value for the function (i.e., the function's DECL_RESULT). This
+is equivalent to the C++ named return value optimization applied to
+GIMPLE. The pass is located in @file{tree-nrv.c} and is described by
+@code{pass_nrv}.
+
+@item Return slot optimization
+
+If a function returns a memory object and is called as @code{var =
+foo()}, this pass tries to change the call so that the address of
+@code{var} is sent to the caller to avoid an extra memory copy. This
+pass is located in @code{tree-nrv.c} and is described by
+@code{pass_return_slot}.
+
+@item Optimize calls to @code{__builtin_object_size}
+
+This is a propagation pass similar to CCP that tries to remove calls
+to @code{__builtin_object_size} when the size of the object can be
+computed at compile-time. This pass is located in
+@file{tree-object-size.c} and is described by
+@code{pass_object_sizes}.
+
+@item Loop invariant motion
+
+This pass removes expensive loop-invariant computations out of loops.
+The pass is located in @file{tree-ssa-loop.c} 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.c} and described by
+@code{pass_empty_loop}.
+
+@item Unrolling of small loops
+
+This pass completely unrolls loops with few iterations. The pass
+is located in @file{tree-ssa-loop-ivcanon.c} and described by
+@code{pass_complete_unroll}.
+
+@item Array prefetching
+
+This pass issues prefetch instructions for array references inside
+loops. The pass is located in @file{tree-ssa-loop-prefetch.c} and
+described by @code{pass_loop_prefetch}.
+
+@item Reassociation
+
+This pass rewrites arithmetic expressions to enable optimizations that
+operate on them, like redundancy elimination and vectorization. The
+pass is located in @file{tree-ssa-reassoc.c} and described by
+@code{pass_reassoc}.
+
+@item Optimization of @code{stdarg} functions
+
+This pass tries to avoid the saving of register arguments into the
+stack on entry to @code{stdarg} functions. If the function doesn't
+use any @code{va_start} macros, no registers need to be saved. If
+@code{va_start} macros are used, the @code{va_list} variables don't
+escape the function, it is only necessary to save registers that will
+be used in @code{va_arg} macros. For instance, if @code{va_arg} is
+only used with integral types in the function, floating point
+registers don't need to be saved. This pass is located in
+@code{tree-stdarg.c} and described by @code{pass_stdarg}.
+
@end itemize
@node RTL passes