tree-flow.h (add_referenced_var_1): Declare.
2012-05-22 Richard Guenther <rguenther@suse.de> * tree-flow.h (add_referenced_var_1): Declare. (add_referenced_var): Define. * tree-dfa.c (referenced_var_check_and_insert): Avoid one hash lookup. (add_referenced_var): Rename to ... (add_referenced_var_1): ... this. Take struct function argument. From-SVN: r187766
This commit is contained in:
parent
95ffee1fce
commit
3efa0725f4
|
@ -1,3 +1,12 @@
|
||||||
|
2012-05-22 Richard Guenther <rguenther@suse.de>
|
||||||
|
|
||||||
|
* tree-flow.h (add_referenced_var_1): Declare.
|
||||||
|
(add_referenced_var): Define.
|
||||||
|
* tree-dfa.c (referenced_var_check_and_insert): Avoid one hash
|
||||||
|
lookup.
|
||||||
|
(add_referenced_var): Rename to ...
|
||||||
|
(add_referenced_var_1): ... this. Take struct function argument.
|
||||||
|
|
||||||
2012-05-22 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
|
2012-05-22 Ramana Radhakrishnan <ramana.radhakrishnan@linaro.org>
|
||||||
|
|
||||||
PR target/53334
|
PR target/53334
|
||||||
|
|
|
@ -503,24 +503,23 @@ referenced_var_lookup (struct function *fn, unsigned int uid)
|
||||||
Return true if it required insertion. */
|
Return true if it required insertion. */
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
referenced_var_check_and_insert (tree to)
|
referenced_var_check_and_insert (tree to, struct function *fn)
|
||||||
{
|
{
|
||||||
tree h, *loc;
|
tree *loc;
|
||||||
struct tree_decl_minimal in;
|
struct tree_decl_minimal in;
|
||||||
unsigned int uid = DECL_UID (to);
|
unsigned int uid = DECL_UID (to);
|
||||||
|
|
||||||
in.uid = uid;
|
in.uid = uid;
|
||||||
h = (tree) htab_find_with_hash (gimple_referenced_vars (cfun), &in, uid);
|
loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (fn),
|
||||||
if (h)
|
&in, uid, INSERT);
|
||||||
|
if (*loc)
|
||||||
{
|
{
|
||||||
/* DECL_UID has already been entered in the table. Verify that it is
|
/* DECL_UID has already been entered in the table. Verify that it is
|
||||||
the same entry as TO. See PR 27793. */
|
the same entry as TO. See PR 27793. */
|
||||||
gcc_assert (h == to);
|
gcc_assert (*loc == to);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
loc = (tree *) htab_find_slot_with_hash (gimple_referenced_vars (cfun),
|
|
||||||
&in, uid, INSERT);
|
|
||||||
*loc = to;
|
*loc = to;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -575,7 +574,7 @@ set_default_def (tree var, tree def)
|
||||||
/* Add VAR to the list of referenced variables if it isn't already there. */
|
/* Add VAR to the list of referenced variables if it isn't already there. */
|
||||||
|
|
||||||
bool
|
bool
|
||||||
add_referenced_var (tree var)
|
add_referenced_var_1 (tree var, struct function *fn)
|
||||||
{
|
{
|
||||||
gcc_checking_assert (TREE_CODE (var) == VAR_DECL
|
gcc_checking_assert (TREE_CODE (var) == VAR_DECL
|
||||||
|| TREE_CODE (var) == PARM_DECL
|
|| TREE_CODE (var) == PARM_DECL
|
||||||
|
@ -585,7 +584,7 @@ add_referenced_var (tree var)
|
||||||
create_var_ann (var);
|
create_var_ann (var);
|
||||||
|
|
||||||
/* Insert VAR into the referenced_vars hash table if it isn't present. */
|
/* Insert VAR into the referenced_vars hash table if it isn't present. */
|
||||||
if (referenced_var_check_and_insert (var))
|
if (referenced_var_check_and_insert (var, fn))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -491,7 +491,8 @@ extern void debug_referenced_vars (void);
|
||||||
extern void dump_referenced_vars (FILE *);
|
extern void dump_referenced_vars (FILE *);
|
||||||
extern void dump_variable (FILE *, tree);
|
extern void dump_variable (FILE *, tree);
|
||||||
extern void debug_variable (tree);
|
extern void debug_variable (tree);
|
||||||
extern bool add_referenced_var (tree);
|
extern bool add_referenced_var_1 (tree, struct function *);
|
||||||
|
#define add_referenced_var(v) add_referenced_var_1 ((v), cfun)
|
||||||
extern void remove_referenced_var (tree);
|
extern void remove_referenced_var (tree);
|
||||||
extern tree make_rename_temp (tree, const char *);
|
extern tree make_rename_temp (tree, const char *);
|
||||||
extern void set_default_def (tree, tree);
|
extern void set_default_def (tree, tree);
|
||||||
|
|
Loading…
Reference in New Issue