diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-22 12:56:47 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-22 12:56:47 +0000 |
commit | 030087e31b1253fb9ed6835a82e93a61ccc02493 (patch) | |
tree | e2bc6c7177a42d1b832555b60d0a854bcb834bd0 /gcc/tree-call-cdce.c | |
parent | b4f314ea97f04620d290f3ae25d831f46692864f (diff) | |
parent | ac875fa40bf5429aff0612943d8c5705c4e11bb5 (diff) | |
download | gcc-030087e31b1253fb9ed6835a82e93a61ccc02493.tar.gz |
Merge from trunk.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/wide-int@209623 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-call-cdce.c')
-rw-r--r-- | gcc/tree-call-cdce.c | 84 |
1 files changed, 40 insertions, 44 deletions
diff --git a/gcc/tree-call-cdce.c b/gcc/tree-call-cdce.c index d25d20d54b2..d8ad5201b8c 100644 --- a/gcc/tree-call-cdce.c +++ b/gcc/tree-call-cdce.c @@ -867,16 +867,51 @@ shrink_wrap_conditional_dead_built_in_calls (vec<gimple> calls) return changed; } -/* Pass entry points. */ +namespace { + +const pass_data pass_data_call_cdce = +{ + GIMPLE_PASS, /* type */ + "cdce", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_execute */ + TV_TREE_CALL_CDCE, /* tv_id */ + ( PROP_cfg | PROP_ssa ), /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_verify_ssa, /* todo_flags_finish */ +}; -static unsigned int -tree_call_cdce (void) +class pass_call_cdce : public gimple_opt_pass +{ +public: + pass_call_cdce (gcc::context *ctxt) + : gimple_opt_pass (pass_data_call_cdce, ctxt) + {} + + /* opt_pass methods: */ + virtual bool gate (function *fun) + { + /* The limit constants used in the implementation + assume IEEE floating point format. Other formats + can be supported in the future if needed. */ + return flag_tree_builtin_call_dce != 0 + && optimize_function_for_speed_p (fun); + } + + virtual unsigned int execute (function *); + +}; // class pass_call_cdce + +unsigned int +pass_call_cdce::execute (function *fun) { basic_block bb; gimple_stmt_iterator i; bool something_changed = false; auto_vec<gimple> cond_dead_built_in_calls; - FOR_EACH_BB_FN (bb, cfun) + FOR_EACH_BB_FN (bb, fun) { /* Collect dead call candidates. */ for (i = gsi_start_bb (bb); !gsi_end_p (i); gsi_next (&i)) @@ -910,52 +945,13 @@ tree_call_cdce (void) free_dominance_info (CDI_POST_DOMINATORS); /* As we introduced new control-flow we need to insert PHI-nodes for the call-clobbers of the remaining call. */ - mark_virtual_operands_for_renaming (cfun); + mark_virtual_operands_for_renaming (fun); return TODO_update_ssa; } return 0; } -static bool -gate_call_cdce (void) -{ - /* The limit constants used in the implementation - assume IEEE floating point format. Other formats - can be supported in the future if needed. */ - return flag_tree_builtin_call_dce != 0 && optimize_function_for_speed_p (cfun); -} - -namespace { - -const pass_data pass_data_call_cdce = -{ - GIMPLE_PASS, /* type */ - "cdce", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - true, /* has_gate */ - true, /* has_execute */ - TV_TREE_CALL_CDCE, /* tv_id */ - ( PROP_cfg | PROP_ssa ), /* properties_required */ - 0, /* properties_provided */ - 0, /* properties_destroyed */ - 0, /* todo_flags_start */ - TODO_verify_ssa, /* todo_flags_finish */ -}; - -class pass_call_cdce : public gimple_opt_pass -{ -public: - pass_call_cdce (gcc::context *ctxt) - : gimple_opt_pass (pass_data_call_cdce, ctxt) - {} - - /* opt_pass methods: */ - bool gate () { return gate_call_cdce (); } - unsigned int execute () { return tree_call_cdce (); } - -}; // class pass_call_cdce - } // anon namespace gimple_opt_pass * |