tree-ssa.h (walk_use_def_chains_fn, [...]): Delete.

2013-09-26  Florian Weimer  <fw@deneb.enyo.de>

	* tree-ssa.h (walk_use_def_chains_fn, walk_use_def_chains): Delete.
	* tree-ssa.c (walk_use_def_chains_1, walk_use_def_chains): Delete.
	* doc/tree-ssa.texi (Walking use-def chains): Delete.

From-SVN: r202951
This commit is contained in:
Florian Weimer 2013-09-26 18:39:28 +02:00 committed by Florian Weimer
parent 74fc8b8ab9
commit 84f48495e9
4 changed files with 6 additions and 141 deletions

View File

@ -1,3 +1,9 @@
2013-09-26 Florian Weimer <fw@deneb.enyo.de>
* tree-ssa.h (walk_use_def_chains_fn, walk_use_def_chains): Delete.
* tree-ssa.c (walk_use_def_chains_1, walk_use_def_chains): Delete.
* doc/tree-ssa.texi (Walking use-def chains): Delete.
2013-09-26 Richard Biener <rguenther@suse.de>
* tree-into-ssa.c (rewrite_into_ssa): Make more SSA names

View File

@ -725,33 +725,6 @@ Returns the version number of the @code{SSA_NAME} object @var{var}.
@end defmac
@subsection Walking use-def chains
@deftypefn {Tree SSA function} void walk_use_def_chains (@var{var}, @var{fn}, @var{data})
Walks use-def chains starting at the @code{SSA_NAME} node @var{var}.
Calls function @var{fn} at each reaching definition found. Function
@var{FN} takes three arguments: @var{var}, its defining statement
(@var{def_stmt}) and a generic pointer to whatever state information
that @var{fn} may want to maintain (@var{data}). Function @var{fn} is
able to stop the walk by returning @code{true}, otherwise in order to
continue the walk, @var{fn} should return @code{false}.
Note, that if @var{def_stmt} is a @code{PHI} node, the semantics are
slightly different. For each argument @var{arg} of the PHI node, this
function will:
@enumerate
@item Walk the use-def chains for @var{arg}.
@item Call @code{FN (@var{arg}, @var{phi}, @var{data})}.
@end enumerate
Note how the first argument to @var{fn} is no longer the original
variable @var{var}, but the PHI argument currently being examined.
If @var{fn} wants to get at @var{var}, it should call
@code{PHI_RESULT} (@var{phi}).
@end deftypefn
@subsection Walking the dominator tree
@deftypefn {Tree SSA function} void walk_dominator_tree (@var{walk_data}, @var{bb})

View File

@ -1347,115 +1347,6 @@ ssa_undefined_value_p (tree t)
}
/* Internal helper for walk_use_def_chains. VAR, FN and DATA are as
described in walk_use_def_chains.
VISITED is a pointer set used to mark visited SSA_NAMEs to avoid
infinite loops. We used to have a bitmap for this to just mark
SSA versions we had visited. But non-sparse bitmaps are way too
expensive, while sparse bitmaps may cause quadratic behavior.
IS_DFS is true if the caller wants to perform a depth-first search
when visiting PHI nodes. A DFS will visit each PHI argument and
call FN after each one. Otherwise, all the arguments are
visited first and then FN is called with each of the visited
arguments in a separate pass. */
static bool
walk_use_def_chains_1 (tree var, walk_use_def_chains_fn fn, void *data,
struct pointer_set_t *visited, bool is_dfs)
{
gimple def_stmt;
if (pointer_set_insert (visited, var))
return false;
def_stmt = SSA_NAME_DEF_STMT (var);
if (gimple_code (def_stmt) != GIMPLE_PHI)
{
/* If we reached the end of the use-def chain, call FN. */
return fn (var, def_stmt, data);
}
else
{
size_t i;
/* When doing a breadth-first search, call FN before following the
use-def links for each argument. */
if (!is_dfs)
for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
if (fn (gimple_phi_arg_def (def_stmt, i), def_stmt, data))
return true;
/* Follow use-def links out of each PHI argument. */
for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
{
tree arg = gimple_phi_arg_def (def_stmt, i);
/* ARG may be NULL for newly introduced PHI nodes. */
if (arg
&& TREE_CODE (arg) == SSA_NAME
&& walk_use_def_chains_1 (arg, fn, data, visited, is_dfs))
return true;
}
/* When doing a depth-first search, call FN after following the
use-def links for each argument. */
if (is_dfs)
for (i = 0; i < gimple_phi_num_args (def_stmt); i++)
if (fn (gimple_phi_arg_def (def_stmt, i), def_stmt, data))
return true;
}
return false;
}
/* Walk use-def chains starting at the SSA variable VAR. Call
function FN at each reaching definition found. FN takes three
arguments: VAR, its defining statement (DEF_STMT) and a generic
pointer to whatever state information that FN may want to maintain
(DATA). FN is able to stop the walk by returning true, otherwise
in order to continue the walk, FN should return false.
Note, that if DEF_STMT is a PHI node, the semantics are slightly
different. The first argument to FN is no longer the original
variable VAR, but the PHI argument currently being examined. If FN
wants to get at VAR, it should call PHI_RESULT (PHI).
If IS_DFS is true, this function will:
1- walk the use-def chains for all the PHI arguments, and,
2- call (*FN) (ARG, PHI, DATA) on all the PHI arguments.
If IS_DFS is false, the two steps above are done in reverse order
(i.e., a breadth-first search). */
void
walk_use_def_chains (tree var, walk_use_def_chains_fn fn, void *data,
bool is_dfs)
{
gimple def_stmt;
gcc_assert (TREE_CODE (var) == SSA_NAME);
def_stmt = SSA_NAME_DEF_STMT (var);
/* We only need to recurse if the reaching definition comes from a PHI
node. */
if (gimple_code (def_stmt) != GIMPLE_PHI)
(*fn) (var, def_stmt, data);
else
{
struct pointer_set_t *visited = pointer_set_create ();
walk_use_def_chains_1 (var, fn, data, visited, is_dfs);
pointer_set_destroy (visited);
}
}
/* If necessary, rewrite the base of the reference tree *TP from
a MEM_REF to a plain or converted symbol. */

View File

@ -56,11 +56,6 @@ extern void delete_tree_ssa (void);
extern bool tree_ssa_useless_type_conversion (tree);
extern tree tree_ssa_strip_useless_type_conversions (tree);
/* Call-back function for walk_use_def_chains(). At each reaching
definition, a function with this prototype is called. */
typedef bool (*walk_use_def_chains_fn) (tree, gimple, void *);
extern void walk_use_def_chains (tree, walk_use_def_chains_fn, void *, bool);
extern bool ssa_undefined_value_p (tree);
extern void execute_update_addresses_taken (void);