diff options
Diffstat (limited to 'gcc/tree-ssa-copyrename.c')
-rw-r--r-- | gcc/tree-ssa-copyrename.c | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/gcc/tree-ssa-copyrename.c b/gcc/tree-ssa-copyrename.c index 65d8044..b9c9ba3 100644 --- a/gcc/tree-ssa-copyrename.c +++ b/gcc/tree-ssa-copyrename.c @@ -299,14 +299,44 @@ copy_rename_partition_coalesce (var_map map, tree var1, tree var2, FILE *debug) } +namespace { + +const pass_data pass_data_rename_ssa_copies = +{ + GIMPLE_PASS, /* type */ + "copyrename", /* name */ + OPTGROUP_NONE, /* optinfo_flags */ + true, /* has_execute */ + TV_TREE_COPY_RENAME, /* 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_rename_ssa_copies : public gimple_opt_pass +{ +public: + pass_rename_ssa_copies (gcc::context *ctxt) + : gimple_opt_pass (pass_data_rename_ssa_copies, ctxt) + {} + + /* opt_pass methods: */ + opt_pass * clone () { return new pass_rename_ssa_copies (m_ctxt); } + virtual bool gate (function *) { return flag_tree_copyrename != 0; } + virtual unsigned int execute (function *); + +}; // class pass_rename_ssa_copies + /* This function will make a pass through the IL, and attempt to coalesce any SSA versions which occur in PHI's or copies. Coalescing is accomplished by changing the underlying root variable of all coalesced version. This will then cause the SSA->normal pass to attempt to coalesce them all to the same variable. */ -static unsigned int -rename_ssa_copies (void) +unsigned int +pass_rename_ssa_copies::execute (function *fun) { var_map map; basic_block bb; @@ -325,7 +355,7 @@ rename_ssa_copies (void) map = init_var_map (num_ssa_names); - FOR_EACH_BB_FN (bb, cfun) + FOR_EACH_BB_FN (bb, fun) { /* Scan for real copies. */ for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) @@ -341,7 +371,7 @@ rename_ssa_copies (void) } } - FOR_EACH_BB_FN (bb, cfun) + FOR_EACH_BB_FN (bb, fun) { /* Treat PHI nodes as copies between the result and each argument. */ for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi)) @@ -429,42 +459,12 @@ rename_ssa_copies (void) replace_ssa_name_symbol (var, SSA_NAME_VAR (part_var)); } - statistics_counter_event (cfun, "copies coalesced", + statistics_counter_event (fun, "copies coalesced", stats.coalesced); delete_var_map (map); return 0; } -namespace { - -const pass_data pass_data_rename_ssa_copies = -{ - GIMPLE_PASS, /* type */ - "copyrename", /* name */ - OPTGROUP_NONE, /* optinfo_flags */ - true, /* has_execute */ - TV_TREE_COPY_RENAME, /* 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_rename_ssa_copies : public gimple_opt_pass -{ -public: - pass_rename_ssa_copies (gcc::context *ctxt) - : gimple_opt_pass (pass_data_rename_ssa_copies, ctxt) - {} - - /* opt_pass methods: */ - opt_pass * clone () { return new pass_rename_ssa_copies (m_ctxt); } - virtual bool gate (function *) { return flag_tree_copyrename != 0; } - unsigned int execute () { return rename_ssa_copies (); } - -}; // class pass_rename_ssa_copies - } // anon namespace gimple_opt_pass * |