aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-operands.c
diff options
context:
space:
mode:
authorjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-24 12:57:24 +0000
committerjamborm <jamborm@138bc75d-0d04-0410-961f-82ee72b054a4>2012-08-24 12:57:24 +0000
commit8d672d129977370f3130030d79f9feb76532a98c (patch)
treeb1213a8631b75e45f38fd88f7776c25b9fafe3b3 /gcc/tree-ssa-operands.c
parent017c5b989ac3e3c65e0af360accad2f3ef281fad (diff)
2012-08-24 Martin Jambor <mjambor@suse.cz>
* predict.c (maybe_hot_frequency_p): New parameter fun. Use its decl instead of current_function_decl, use profile_status_for_function and ENTRY_BLOCK_PTR_FOR_FUNCTION with fun instead of their cfun variants. (maybe_hot_count_p): New parameter fun, use profile_status_for_function instead of its cfun_variant. (maybe_hot_bb_p): New parameter fun, checking-assert it, pass it to all callees. (maybe_hot_edge_p): Pass cfun to maybe_hot_count_p and maybe_hot_frequency_p. (probably_never_executed_bb_p): New parameter fun, use its decl instead of current_function_decl. (optimize_bb_for_size_p): Pass cfun to maybe_hot_bb_p. (rtl_profile_for_bb): Likewise. (compute_function_frequency): Pass cfun to maybe_hot_bb_p and probably_never_executed_bb_p. * tree-ssa-operands.c (ssa_operands_active): New operator fun. Use it instead of cfun. (update_stmt_operands): Pass cfun as an argument of ssa_operands_active. (swap_tree_operands): Likewise. * gimple-iterator.c (update_modified_stmt): Likewise. (update_modified_stmts): Likewise. * tree-flow-inline.h (delink_stmt_imm_use): Likewise. * tree-ssa.c (delete_tree_ssa): Likewise. * bb-reorder.c (bb_to_key): Pass cfun to probably_never_executed_bb_p. (push_to_next_round_p): Likewise. (find_rarely_executed_basic_blocks_and_crossing_edges ): Likewise. * cfg.c: Inlude tree.h. (check_bb_profile): Use profile_status_for_function, EXIT_BLOCK_PTR_FOR_FUNCTION and ENTRY_BLOCK_PTR_FOR_FUNCTION with DECL_STRUCT_FUNCTION (current_function_decl) instead of their cfun variants. (dump_bb_info): Pass DECL_STRUCT_FUNCTION (current_function_decl) to maybe_hot_bb_p and probably_never_executed_bb_p. * gimple-pretty-print.c (gimple_dump_bb_buff): Checking-assert that DECL_STRUCT_FUNCTION (current_function_decl) is not NULL. Pass it to dump_histograms_for_stmt. (dump_gimple_mem_ops): Pass DECL_STRUCT_FUNCTION (current_function_decl) as an argument to dump_gimple_mem_ops. * tree-cfg.c (dump_function_to_file): Rename parameter fn to fndecl. Do not change cfun. Change and restore current_function_decl. * Makefile.in (cfg.o): Include TREE_H in dependencies. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@190645 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-operands.c')
-rw-r--r--gcc/tree-ssa-operands.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/tree-ssa-operands.c b/gcc/tree-ssa-operands.c
index 3a1f989c8b7..d9b3146cf4f 100644
--- a/gcc/tree-ssa-operands.c
+++ b/gcc/tree-ssa-operands.c
@@ -130,16 +130,12 @@ static int n_initialized = 0;
/* Return true if the SSA operands cache is active. */
bool
-ssa_operands_active (void)
+ssa_operands_active (struct function *fun)
{
- /* This function may be invoked from contexts where CFUN is NULL
- (IPA passes), return false for now. FIXME: operands may be
- active in each individual function, maybe this function should
- take CFUN as a parameter. */
- if (cfun == NULL)
+ if (fun == NULL)
return false;
- return cfun->gimple_df && gimple_ssa_operands (cfun)->ops_active;
+ return fun->gimple_df && gimple_ssa_operands (fun)->ops_active;
}
@@ -1211,7 +1207,7 @@ update_stmt_operands (gimple stmt)
{
/* If update_stmt_operands is called before SSA is initialized, do
nothing. */
- if (!ssa_operands_active ())
+ if (!ssa_operands_active (cfun))
return;
timevar_push (TV_TREE_OPS);
@@ -1244,7 +1240,7 @@ swap_tree_operands (gimple stmt, tree *exp0, tree *exp1)
positions of these two operands in their respective immediate use
lists by adjusting their use pointer to point to the new
operand position. */
- if (ssa_operands_active () && op0 != op1)
+ if (ssa_operands_active (cfun) && op0 != op1)
{
use_optype_p use0, use1, ptr;
use0 = use1 = NULL;