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/recog.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/recog.c')
-rw-r--r-- | gcc/recog.c | 144 |
1 files changed, 66 insertions, 78 deletions
diff --git a/gcc/recog.c b/gcc/recog.c index 81184c5ff7b..653c5358b74 100644 --- a/gcc/recog.c +++ b/gcc/recog.c @@ -3854,12 +3854,6 @@ if_test_bypass_p (rtx out_insn, rtx in_insn) return true; } -static bool -gate_handle_peephole2 (void) -{ - return (optimize > 0 && flag_peephole2); -} - static unsigned int rest_of_handle_peephole2 (void) { @@ -3876,7 +3870,6 @@ const pass_data pass_data_peephole2 = RTL_PASS, /* type */ "peephole2", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - true, /* has_gate */ true, /* has_execute */ TV_PEEPHOLE2, /* tv_id */ 0, /* properties_required */ @@ -3897,8 +3890,11 @@ public: /* The epiphany backend creates a second instance of this pass, so we need a clone method. */ opt_pass * clone () { return new pass_peephole2 (m_ctxt); } - bool gate () { return gate_handle_peephole2 (); } - unsigned int execute () { return rest_of_handle_peephole2 (); } + virtual bool gate (function *) { return (optimize > 0 && flag_peephole2); } + virtual unsigned int execute (function *) + { + return rest_of_handle_peephole2 (); + } }; // class pass_peephole2 @@ -3910,13 +3906,6 @@ make_pass_peephole2 (gcc::context *ctxt) return new pass_peephole2 (ctxt); } -static unsigned int -rest_of_handle_split_all_insns (void) -{ - split_all_insns (); - return 0; -} - namespace { const pass_data pass_data_split_all_insns = @@ -3924,7 +3913,6 @@ const pass_data pass_data_split_all_insns = RTL_PASS, /* type */ "split1", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - false, /* has_gate */ true, /* has_execute */ TV_NONE, /* tv_id */ 0, /* properties_required */ @@ -3945,7 +3933,11 @@ public: /* The epiphany backend creates a second instance of this pass, so we need a clone method. */ opt_pass * clone () { return new pass_split_all_insns (m_ctxt); } - unsigned int execute () { return rest_of_handle_split_all_insns (); } + virtual unsigned int execute (function *) + { + split_all_insns (); + return 0; + } }; // class pass_split_all_insns @@ -3975,7 +3967,6 @@ const pass_data pass_data_split_after_reload = RTL_PASS, /* type */ "split2", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - false, /* has_gate */ true, /* has_execute */ TV_NONE, /* tv_id */ 0, /* properties_required */ @@ -3993,7 +3984,10 @@ public: {} /* opt_pass methods: */ - unsigned int execute () { return rest_of_handle_split_after_reload (); } + virtual unsigned int execute (function *) + { + return rest_of_handle_split_after_reload (); + } }; // class pass_split_after_reload @@ -4005,31 +3999,6 @@ make_pass_split_after_reload (gcc::context *ctxt) return new pass_split_after_reload (ctxt); } -static bool -gate_handle_split_before_regstack (void) -{ -#if HAVE_ATTR_length && defined (STACK_REGS) - /* If flow2 creates new instructions which need splitting - and scheduling after reload is not done, they might not be - split until final which doesn't allow splitting - if HAVE_ATTR_length. */ -# ifdef INSN_SCHEDULING - return (optimize && !flag_schedule_insns_after_reload); -# else - return (optimize); -# endif -#else - return 0; -#endif -} - -static unsigned int -rest_of_handle_split_before_regstack (void) -{ - split_all_insns (); - return 0; -} - namespace { const pass_data pass_data_split_before_regstack = @@ -4037,7 +4006,6 @@ const pass_data pass_data_split_before_regstack = RTL_PASS, /* type */ "split3", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - true, /* has_gate */ true, /* has_execute */ TV_NONE, /* tv_id */ 0, /* properties_required */ @@ -4055,13 +4023,33 @@ public: {} /* opt_pass methods: */ - bool gate () { return gate_handle_split_before_regstack (); } - unsigned int execute () { - return rest_of_handle_split_before_regstack (); - } + virtual bool gate (function *); + virtual unsigned int execute (function *) + { + split_all_insns (); + return 0; + } }; // class pass_split_before_regstack +bool +pass_split_before_regstack::gate (function *) +{ +#if HAVE_ATTR_length && defined (STACK_REGS) + /* If flow2 creates new instructions which need splitting + and scheduling after reload is not done, they might not be + split until final which doesn't allow splitting + if HAVE_ATTR_length. */ +# ifdef INSN_SCHEDULING + return (optimize && !flag_schedule_insns_after_reload); +# else + return (optimize); +# endif +#else + return 0; +#endif +} + } // anon namespace rtl_opt_pass * @@ -4070,16 +4058,6 @@ make_pass_split_before_regstack (gcc::context *ctxt) return new pass_split_before_regstack (ctxt); } -static bool -gate_handle_split_before_sched2 (void) -{ -#ifdef INSN_SCHEDULING - return optimize > 0 && flag_schedule_insns_after_reload; -#else - return 0; -#endif -} - static unsigned int rest_of_handle_split_before_sched2 (void) { @@ -4096,7 +4074,6 @@ const pass_data pass_data_split_before_sched2 = RTL_PASS, /* type */ "split4", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - true, /* has_gate */ true, /* has_execute */ TV_NONE, /* tv_id */ 0, /* properties_required */ @@ -4114,8 +4091,19 @@ public: {} /* opt_pass methods: */ - bool gate () { return gate_handle_split_before_sched2 (); } - unsigned int execute () { return rest_of_handle_split_before_sched2 (); } + virtual bool gate (function *) + { +#ifdef INSN_SCHEDULING + return optimize > 0 && flag_schedule_insns_after_reload; +#else + return false; +#endif + } + + virtual unsigned int execute (function *) + { + return rest_of_handle_split_before_sched2 (); + } }; // class pass_split_before_sched2 @@ -4127,18 +4115,6 @@ make_pass_split_before_sched2 (gcc::context *ctxt) return new pass_split_before_sched2 (ctxt); } -/* The placement of the splitting that we do for shorten_branches - depends on whether regstack is used by the target or not. */ -static bool -gate_do_final_split (void) -{ -#if HAVE_ATTR_length && !defined (STACK_REGS) - return 1; -#else - return 0; -#endif -} - namespace { const pass_data pass_data_split_for_shorten_branches = @@ -4146,7 +4122,6 @@ const pass_data pass_data_split_for_shorten_branches = RTL_PASS, /* type */ "split5", /* name */ OPTGROUP_NONE, /* optinfo_flags */ - true, /* has_gate */ true, /* has_execute */ TV_NONE, /* tv_id */ 0, /* properties_required */ @@ -4164,8 +4139,21 @@ public: {} /* opt_pass methods: */ - bool gate () { return gate_do_final_split (); } - unsigned int execute () { return split_all_insns_noflow (); } + virtual bool gate (function *) + { + /* The placement of the splitting that we do for shorten_branches + depends on whether regstack is used by the target or not. */ +#if HAVE_ATTR_length && !defined (STACK_REGS) + return true; +#else + return false; +#endif + } + + virtual unsigned int execute (function *) + { + return split_all_insns_noflow (); + } }; // class pass_split_for_shorten_branches |