diff options
author | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 12:37:34 +0000 |
---|---|---|
committer | tbsaunde <tbsaunde@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-04-17 12:37:34 +0000 |
commit | 65b0537f9e9741318f7c8e738b6dd3b8f82f58b5 (patch) | |
tree | 2c7de59d1f6572c580defbe0ccac2d0b83cd1eb3 /gcc/loop-init.c | |
parent | 31315c249fd6c60b4a598dcd261d50a11d78b5d0 (diff) | |
download | gcc-65b0537f9e9741318f7c8e738b6dd3b8f82f58b5.tar.gz |
pass cfun to pass::execute
gcc/
* passes.c (opt_pass::execute): Adjust.
(pass_manager::execute_pass_mode_switching): Likewise.
(early_local_passes::execute): Likewise.
(execute_one_pass): Pass cfun to the pass's execute method.
* tree-pass.h (opt_pass::execute): Add function * argument.
* asan.c, auto-inc-dec.c, bb-reorder.c, bt-load.c, cfgcleanup.c,
cfgexpand.c, cfgrtl.c, cgraphbuild.c, combine-stack-adj.c, combine.c,
compare-elim.c, config/arc/arc.c, config/epiphany/mode-switch-use.c,
config/epiphany/resolve-sw-modes.c, config/i386/i386.c,
config/mips/mips.c, config/rl78/rl78.c, config/s390/s390.c,
config/sparc/sparc.c, cprop.c, dce.c, df-core.c, dse.c, dwarf2cfi.c,
except.c, final.c, function.c, fwprop.c, gcse.c, gimple-low.c,
gimple-ssa-isolate-paths.c, gimple-ssa-strength-reduction.c,
graphite.c, ifcvt.c, init-regs.c, ipa-cp.c, ipa-devirt.c,
ipa-inline-analysis.c, ipa-inline.c, ipa-profile.c, ipa-pure-const.c,
ipa-reference.c, ipa-split.c, ipa.c, ira.c, jump.c, loop-init.c,
lower-subreg.c, mode-switching.c, omp-low.c, postreload-gcse.c,
postreload.c, predict.c, recog.c, ree.c, reg-stack.c, regcprop.c,
reginfo.c, regrename.c, reorg.c, sched-rgn.c, stack-ptr-mod.c,
store-motion.c, tracer.c, trans-mem.c, tree-call-cdce.c, tree-cfg.c,
tree-cfgcleanup.c, tree-complex.c, tree-eh.c, tree-emutls.c,
tree-if-conv.c, tree-into-ssa.c, tree-loop-distribution.c, tree-nrv.c,
tree-object-size.c, tree-parloops.c, tree-predcom.c, tree-ssa-ccp.c,
tree-ssa-copy.c, tree-ssa-copyrename.c, tree-ssa-dce.c,
tree-ssa-dom.c, tree-ssa-dse.c, tree-ssa-forwprop.c,
tree-ssa-ifcombine.c, tree-ssa-loop-ch.c, tree-ssa-loop-im.c,
tree-ssa-loop-ivcanon.c, tree-ssa-loop-prefetch.c,
tree-ssa-loop-unswitch.c, tree-ssa-loop.c, tree-ssa-math-opts.c,
tree-ssa-phiopt.c, tree-ssa-phiprop.c, tree-ssa-pre.c,
tree-ssa-reassoc.c, tree-ssa-sink.c, tree-ssa-strlen.c,
tree-ssa-structalias.c, tree-ssa-uncprop.c, tree-ssa-uninit.c,
tree-ssa.c, tree-ssanames.c, tree-stdarg.c, tree-switch-conversion.c,
tree-tailcall.c, tree-vect-generic.c, tree-vectorizer.c, tree-vrp.c,
tree.c, tsan.c, ubsan.c, var-tracking.c, vtable-verify.c, web.c:
Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209482 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop-init.c')
-rw-r--r-- | gcc/loop-init.c | 135 |
1 files changed, 65 insertions, 70 deletions
diff --git a/gcc/loop-init.c b/gcc/loop-init.c index 6da29d3c0f1..90453f67eca 100644 --- a/gcc/loop-init.c +++ b/gcc/loop-init.c @@ -390,7 +390,7 @@ public: {} /* opt_pass methods: */ - unsigned int execute () { return rtl_loop_init (); } + virtual unsigned int execute (function *) { return rtl_loop_init (); } }; // class pass_rtl_loop_init @@ -405,24 +405,6 @@ make_pass_rtl_loop_init (gcc::context *ctxt) /* Finalization of the RTL loop passes. */ -static unsigned int -rtl_loop_done (void) -{ - /* No longer preserve loops, remove them now. */ - cfun->curr_properties &= ~PROP_loops; - loop_optimizer_finalize (); - free_dominance_info (CDI_DOMINATORS); - - cleanup_cfg (0); - if (dump_file) - { - dump_reg_info (dump_file); - dump_flow_info (dump_file, dump_flags); - } - - return 0; -} - namespace { const pass_data pass_data_rtl_loop_done = @@ -447,10 +429,28 @@ public: {} /* opt_pass methods: */ - unsigned int execute () { return rtl_loop_done (); } + virtual unsigned int execute (function *); }; // class pass_rtl_loop_done +unsigned int +pass_rtl_loop_done::execute (function *fun) +{ + /* No longer preserve loops, remove them now. */ + fun->curr_properties &= ~PROP_loops; + loop_optimizer_finalize (); + free_dominance_info (CDI_DOMINATORS); + + cleanup_cfg (0); + if (dump_file) + { + dump_reg_info (dump_file); + dump_flow_info (dump_file, dump_flags); + } + + return 0; +} + } // anon namespace rtl_opt_pass * @@ -461,13 +461,6 @@ make_pass_rtl_loop_done (gcc::context *ctxt) /* Loop invariant code motion. */ -static unsigned int -rtl_move_loop_invariants (void) -{ - if (number_of_loops (cfun) > 1) - move_loop_invariants (); - return 0; -} namespace { @@ -495,7 +488,12 @@ public: /* opt_pass methods: */ virtual bool gate (function *) { return flag_move_loop_invariants; } - unsigned int execute () { return rtl_move_loop_invariants (); } + virtual unsigned int execute (function *fun) + { + if (number_of_loops (fun) > 1) + move_loop_invariants (); + return 0; + } }; // class pass_rtl_move_loop_invariants @@ -508,14 +506,6 @@ make_pass_rtl_move_loop_invariants (gcc::context *ctxt) } -static unsigned int -rtl_unswitch (void) -{ - if (number_of_loops (cfun) > 1) - unswitch_loops (); - return 0; -} - namespace { const pass_data pass_data_rtl_unswitch = @@ -541,7 +531,12 @@ public: /* opt_pass methods: */ virtual bool gate (function *) { return flag_unswitch_loops; } - unsigned int execute () { return rtl_unswitch (); } + virtual unsigned int execute (function *fun) + { + if (number_of_loops (fun) > 1) + unswitch_loops (); + return 0; + } }; // class pass_rtl_unswitch @@ -554,27 +549,6 @@ make_pass_rtl_unswitch (gcc::context *ctxt) } -static unsigned int -rtl_unroll_and_peel_loops (void) -{ - if (number_of_loops (cfun) > 1) - { - int flags = 0; - if (dump_file) - df_dump (dump_file); - - if (flag_peel_loops) - flags |= UAP_PEEL; - if (flag_unroll_loops) - flags |= UAP_UNROLL; - if (flag_unroll_all_loops) - flags |= UAP_UNROLL_ALL; - - unroll_and_peel_loops (flags); - } - return 0; -} - namespace { const pass_data pass_data_rtl_unroll_and_peel_loops = @@ -604,10 +578,31 @@ public: return (flag_peel_loops || flag_unroll_loops || flag_unroll_all_loops); } - unsigned int execute () { return rtl_unroll_and_peel_loops (); } + virtual unsigned int execute (function *); }; // class pass_rtl_unroll_and_peel_loops +unsigned int +pass_rtl_unroll_and_peel_loops::execute (function *fun) +{ + if (number_of_loops (fun) > 1) + { + int flags = 0; + if (dump_file) + df_dump (dump_file); + + if (flag_peel_loops) + flags |= UAP_PEEL; + if (flag_unroll_loops) + flags |= UAP_UNROLL; + if (flag_unroll_all_loops) + flags |= UAP_UNROLL_ALL; + + unroll_and_peel_loops (flags); + } + return 0; +} + } // anon namespace rtl_opt_pass * @@ -617,16 +612,6 @@ make_pass_rtl_unroll_and_peel_loops (gcc::context *ctxt) } -static unsigned int -rtl_doloop (void) -{ -#ifdef HAVE_doloop_end - if (number_of_loops (cfun) > 1) - doloop_optimize_loops (); -#endif - return 0; -} - namespace { const pass_data pass_data_rtl_doloop = @@ -652,7 +637,7 @@ public: /* opt_pass methods: */ virtual bool gate (function *); - unsigned int execute () { return rtl_doloop (); } + virtual unsigned int execute (function *); }; // class pass_rtl_doloop @@ -666,6 +651,16 @@ pass_rtl_doloop::gate (function *) #endif } +unsigned int +pass_rtl_doloop::execute (function *fun ATTRIBUTE_UNUSED) +{ +#ifdef HAVE_doloop_end + if (number_of_loops (fun) > 1) + doloop_optimize_loops (); +#endif + return 0; +} + } // anon namespace rtl_opt_pass * |