gcc/gcc/reginfo.c

1437 lines
42 KiB
C
Raw Normal View History

tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
/* Compute different info about registers.
2000-02-26 06:45:17 +01:00
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996
1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
2009 Free Software Foundation, Inc.
1991-11-06 00:39:50 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
This file is part of GCC.
1991-11-06 00:39:50 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Software Foundation; either version 3, or (at your option) any later
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
version.
1991-11-06 00:39:50 +01:00
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
1991-11-06 00:39:50 +01:00
You should have received a copy of the GNU General Public License
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
1991-11-06 00:39:50 +01:00
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
/* This file contains regscan pass of the compiler and passes for
dealing with info about modes of pseudo-registers inside
subregisters. It also defines some tables of information about the
hardware registers, function init_reg_sets to initialize the
tables, and other auxiliary functions to deal with info about
registers and their classes. */
1991-11-06 00:39:50 +01:00
#include "config.h"
Major cutover to using system.h: * Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o, c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o, caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o, dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o, expr.o, final.o, flow.o, function.o, getpwd.o, global.o, integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o, prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o, reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o, rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o, tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend on system.h. * alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c, c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c, caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c, dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c, expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c, integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c, prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c, reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c, rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c, stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c, xcoffout.c: Include system.h. Organize include ordering so that stdarg/varargs comes before other system headers. Remove spurious casts of functions assured of a prototype in system.h. From-SVN: r18726
1998-03-20 15:58:42 +01:00
#include "system.h"
#include "coretypes.h"
#include "tm.h"
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
#include "hard-reg-set.h"
1991-11-06 00:39:50 +01:00
#include "rtl.h"
#include "expr.h"
#include "tm_p.h"
1991-11-06 00:39:50 +01:00
#include "flags.h"
#include "basic-block.h"
#include "regs.h"
bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin-protos.h (bfin_dsp_memref_p): Declare. * config/bfin/bfin.c (bfin_dsp_memref_p): New function. (bfin_valid_reg_p): Test for pseudos explicitly and use only REGNO_MODE_CODE_OK_FOR_BASE_P. New args MODE and OUTER_CODE; all callers changed. * config/bfin/bfin.h (PREG_P): Use P_REGNO_P. (IREG_P, P_REGNO_P, I_REGNO_P): New macros. (enum reg_class, REG_CLASS_CONTENTS): Add IPREGS. (BASE_REG_CLASS, REG_OK_FOR_BASE_P, REG_OK_FOR_INDEX_P, REGNO_OK_FOR_BASE_STRICT_P, REGNO_OK_FOR_BASE_NONSTRICT_P): Delete macros. (IREG_POSSIBLE_P, MODE_CODE_BASE_REG_CLASS, REGNO_MODE_CODE_OK_FOR_BASE_P): New macros. (REGNO_REG_CLASS): ARGP is in PREGS. * config/bfin/bfin.md (movhi_insn): Allow for addresses containing IREGS. (zero_extendhisi2, extendhisi2): Likewise; changed to define_and_split to deal with those addresses. * addresses.h: New file. * caller-save.c: Include "addresses.h". (init_caller_save): Use new base_reg_class function. * rtl-factoring.c: Include "addresses.h". (recompute_gain_for_pattern_seq): Use new function ok_for_base_p_1. * recog.c: Include "addresses.h". (preprocess_constraints): Use new base_reg_class function. * regrename.c: Include "addresses.h". (scan_rtx_address): Use new regno_ok_for_base_p and base_reg_class functions. Keep track of a new var INDEX_CODE to compute valid classes. (replace_oldest_value_addr): Likewise. (replace_oldest_value_mem): Use base_reg_class. * reload.c: Include "addresses.h". (REGNO_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P): Delete macros. (find_reloads): Use new base_reg_class function. (find_reloads_address): Likewise; also use regno_ok_for_base_p. (find_reloads_address_1): Likewise. New args OUTER_CODE and INDEX_CODE; all callers and prototype changed. * reload1.c: Include "addresses.h". (maybe_fix_stack_asms): Use base_reg_class. * regclass.c: Include "addresses.h". (ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): New functions. (init_reg_autoinc): Use new base_reg_class function. (record_reg_classes): Likewise. (record_address_regs): Delete arg CLASS; add args CONTEXT, MODE, OUTER_CODE and INDEX_CODE. All callers and prototype changed. Use new args to compute necessary class. * Makefile.in (regclass.o, reload.o, reload1.o, caller-save.o, recog.o, regrename.o, rtl-factoring.o): Update dependencies. * doc/tm.texi (MODE_CODE_BASE_REG_CLASS): Document. (REGNO_MODE_CODE_OK_FOR_BASE_P): Likewise. (REG_OK_FOR_BASE_P, REG_MODE_OK_FOR_BASE_P, REG_MODE_OK_FOR_REG_BASE_P, REG_OK_FOR_INDEX_P): Delete documentation. From-SVN: r112248
2006-03-21 14:07:33 +01:00
#include "addresses.h"
#include "function.h"
1991-11-06 00:39:50 +01:00
#include "insn-config.h"
#include "recog.h"
#include "reload.h"
#include "real.h"
#include "toplev.h"
Warning fixes: * Makefile.in (c-lang.o): Depend on c-tree.h, c-lex.h and toplev.h. (c-lex.o): Depend on output.h. (c-common.o): Likewise. (stmt.o): Likewise. (calls.o): Likewise. (integrate.o): Depend on toplev.h. (regclass.o): Depend on output.h. (final.o): Depend on reload.h. * c-common.c: Include output.h. (check_format_info): Remove unused variable `integral_format'. * c-decl.c (print_lang_decl): Mark parameters `file', `node' and `indent' with ATTRIBUTE_UNUSED. (print_lang_type): Likewise. (maybe_build_cleanup): Likewise for parameter `decl'. (copy_lang_decl): Likewise for parameter `node'. * c-lang.c: Include c-tree.h, c-lex.h and toplev.h. (lang_print_xnode): Mark parameters `file', `node' and `indent' with ATTRIBUTE_UNUSED. (lookup_interface): Likewise for parameter `arg'. (is_class_name): Likewise. (maybe_objc_check_decl): Likewise for parameter `decl'. (maybe_objc_comptypes): Likewise for parameters `lhs', `rhs' and `reflexive'. (maybe_objc_method_name): Likewise for parameter `decl'. (build_objc_string): Likewise for parameters `len' and `str'. * c-lex.c: Include output.h. * c-lex.h (position_after_white_space): Correct typo in prototype. * c-tree.h (finish_file, c_expand_start_cond, c_expand_start_else, c_expand_end_cond, init_iterators): Add prototypes. * caller-save.c (set_reg_live): Mark parameters `reg' and `setter' with ATTRIBUTE_UNUSED. * calls.c: Include output.h. * cccp.c (pipe_closed): Mark parameter `signo' with ATTRIBUTE_UNUSED. * combine.c: Move inclusion of expr.h to after insn-config.h. * iris6.h (ASM_IDENTIFY_GCC, ASM_IDENTIFY_LANGUAGE): Don't define as empty, rather define as ((void)0). * sparc.c (sparc_check_64): Add braces around ambiguous `else'. Add parentheses around assignment used as truth value. * cplus-dem.c (squangle_mop_up): Change return type to void. (internal_cplus_demangle): Remove unused parameter `options'. All callers changed. (cplus_demangle_opname): Remove function wide variable `int i' and replace with `size_t i' at each location where it is used. (cplus_demangle_opname): change type of `i' from int to size_t. * cppexp.c (right_shift): Mark parameter `pfile' with ATTRIBUTE_UNUSED. * cpphash.c (cpp_lookup): Likewise. (cpp_hash_cleanup): Likewise. * cpplib.c (parse_name): Add a prototype and make it static. (null_underflow): Mark parameter `pfile' with ATTRIBUTE_UNUSED. (null_cleanup): Likewise for parameters `pbuf' and `pfile'. (macro_cleanup): Likewise for parameter `pfile'. (file_cleanup): Likewise. * cpplib.h (cpp_reader_init, cpp_options_init, cpp_start_read, cpp_read_check_assertion, skip_rest_of_line): Add prototypes. * crtstuff.c (force_to_data, __CTOR_LIST__, force_to_data, __DTOR_END__, __FRAME_END__): Mark with ATTRIBUTE_UNUSED. * cse.c (cse_check_loop_start): Mark parameter `set' with ATTRIBUTE_UNUSED. * dbxout.c (flag_minimal_debug, have_used_extensions, source_label_number): Move inside macro wrapper check against defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO). * dwarf2out.c (gen_entry_point_die): Hide prototype and definition. * except.h (doing_eh): Provide prototype. * expr.c: Move inclusion of expr.h to after insn-config.h. * final.c: Include reload.h. (shorten_branches): Cast the first argument of bzero to char *. * fix-header.c (cpp_print_containing_files): Mark parameter `pfile' with ATTRIBUTE_UNUSED. (cpp_fatal): Likewise. * flow.c (find_basic_blocks_1): Cast the first argument of bzero to char *. * genattrtab.c (make_length_attrs): Change the type of variable `i' from int to size_t. (zero_fn): Mark parameter `exp' with ATTRIBUTE_UNUSED. (one_fn): Likewise. * genextract.c (main): When generating insn-extract.c, mark variable `junk' with ATTRIBUTE_UNUSED. * gengenrtl.c (gencode): When generating genrtl.c, cast the first argument of bzero to char*. * integrate.c: Include toplev.h. * libgcc2.c: Wrap `struct exception_table' and `find_exception_handler' in macro DWARF2_UNWIND_INFO. * objc/Make-lang.in (objc-act.o): Depend on toplev.h. * objc/objc-act.c: Include toplev.h. (lang_print_xnode): Mark parameters `file', `node' and `indent' with ATTRIBUTE_UNUSED. (finish_protocol): Likewise for parameter `protocol'. * output.h (declare_weak): Add prototype. (decode_reg_name): Don't wrap with TREE_CODE macro. (assemble_alias): Add prototype. * regclass.c: Include output.h. * reload.h (reloads_conflict): Add prototype. * rtl.h (print_rtl_single, mark_elimiation, reg_class_subset_p, output_func_start_profiler): Add prototypes. * rtlanal.c (reg_set_p_1): Mark parameters `x' and `pat' with ATTRIBUTE_UNUSED. * scan-decls.c: Include scan.h. * scan.h (recognized_function, recognized_extern): Add prototypes. * stmt.c: Include output.h. * toplev.c (error_for_asm, warning_for_asm): Remove prototypes. (output_lang_identify): Hide prototype and definition. (float_signal): Mark parameter `signo' with ATTRIBUTE_UNUSED. (pipe_closed): Likewise. * toplev.h (count_error, strip_off_ending, error_for_asm, warning_for_asm): Add prototypes. From-SVN: r19712
1998-05-13 14:40:39 +02:00
#include "output.h"
#include "ggc.h"
#include "timevar.h"
#include "hashtab.h"
re PR target/21623 (ICE in reload_cse_simplify_operands, at postreload.c:391) PR target/21623: * regclass.c (FORBIDDEN_INC_DEC_CLASSES): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. (init_fake_stack_mems): Remove HAVE_SECONDARY_RELOADS test. (memory_move_secondary_cost, init_reg_autoinc): Remove SECONDARY_INPUT_RELOAD_CLASS / SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. (copy_cost): Likewise. Add new parameter prev_sri. Changed all callers. * reload.c (entire file): Remove HAVE_SECONDARY_RELOADS checks. (push_secondary_reload): Use secondary_reload target hook. (secondary_reload_class, scratch_reload_class): New functions. (push_reload): Remove SECONDARY_INPUT_RELOAD_CLASS and SECONDARY_OUTPUT_RELOAD_CLASS tests. Replace SECONDARY_{IN,OUT}PUT_RELOAD_CLASS use with secondary_reload_class call. * reload.h (HAVE_SECONDARY_RELOADS): Don't define nor test. (secondary_reload_class, scratch_reload_class): Declare. * reload1.c: Include target.h. (reload_adjust_reg_for_temp): New function. (reload_adjust_reg_for_icode): Likewise. (choose_reload_regs): Remove SECONDARY_INPUT_RELOAD_CLASS test. Replace SECONDARY_INPUT_RELOAD_CLASS use with secondary_reload_class call. (emit_input_reload_insns): Likewise. Rewrite secondary reload checks for inheritance. Support case when both secondary & tertiary reloads are for intermediate registers. (emit_output_reload_insns): Replace SECONDARY_OUTPUT_RELOAD_CLASS use with secondary_reload_class call. Support case when both secondary & tertiary reloads are for intermediate registers. * target-def.h (TARGET_SECONDARY_RELOAD): Provide default definition. (TARGET_INITIALIZER) Add TARGET_SECONDARY_RELOAD. * target.h (secondary_reload_info): New struct / typedef. (struct gcc_target): New member secondary_reload. * targhooks.c Include reload.h, optabs.h and recog.h. (default_secondary_reload): New function. * targhooks.h (default_secondary_reload): Declare. * doc/tm.texi: Document secondary_reload target hook. Update description of SECONDARY_*RELOAD_CLASS and reload_{in,out}<mode>. * doc/md.texi: Likewise. * sh-protos.h (sh_secondary_reload): Declare. * sh.c (TARGET_SECONDARY_RELOAD): Override. (sh_secondary_reload): New function. * sh.h (SECONDARY_INOUT_RELOAD_CLASS): Don't define. (SECONDARY_OUTPUT_RELOAD_CLASS): Likewise. (SECONDARY_INPUT_RELOAD_CLASS): Likewise. (HAVE_SECONDARY_RELOADS): Define. * sh.md (reload_indf): Rename to: (reload_indf__frn). (reload_outdf): Rename to: (reload_outdf__RnFRm). (reload_insf): Rename to: (reload_insf__frn). (reload_insi): Rename to: (reload_insi__i_fpul). From-SVN: r107468
2005-11-24 19:55:53 +01:00
#include "target.h"
#include "tree-pass.h"
#include "df.h"
#include "ira.h"
/* Maximum register number used in this function, plus one. */
int max_regno;
1991-11-06 00:39:50 +01:00
/* Register tables used by many passes. */
/* Indexed by hard register number, contains 1 for registers
that are fixed use (stack pointer, pc, frame pointer, etc.).
These are the registers that cannot be used to allocate
a pseudo reg for general use. */
1991-11-06 00:39:50 +01:00
char fixed_regs[FIRST_PSEUDO_REGISTER];
/* Same info as a HARD_REG_SET. */
HARD_REG_SET fixed_reg_set;
/* Data for initializing the above. */
static const char initial_fixed_regs[] = FIXED_REGISTERS;
1991-11-06 00:39:50 +01:00
/* Indexed by hard register number, contains 1 for registers
that are fixed use or are clobbered by function calls.
These are the registers that cannot be used to allocate
a pseudo reg whose life crosses calls unless we are able
to save/restore them across the calls. */
1991-11-06 00:39:50 +01:00
char call_used_regs[FIRST_PSEUDO_REGISTER];
/* Same info as a HARD_REG_SET. */
HARD_REG_SET call_used_reg_set;
/* Data for initializing the above. */
static const char initial_call_used_regs[] = CALL_USED_REGISTERS;
/* This is much like call_used_regs, except it doesn't have to
be a superset of FIXED_REGISTERS. This vector indicates
what is really call clobbered, and is used when defining
regs_invalidated_by_call. */
#ifdef CALL_REALLY_USED_REGISTERS
char call_really_used_regs[] = CALL_REALLY_USED_REGISTERS;
#endif
#ifdef CALL_REALLY_USED_REGISTERS
#define CALL_REALLY_USED_REGNO_P(X) call_really_used_regs[X]
#else
#define CALL_REALLY_USED_REGNO_P(X) call_used_regs[X]
#endif
/* Contains registers that are fixed use -- i.e. in fixed_reg_set -- or
a function value return register or TARGET_STRUCT_VALUE_RTX or
STATIC_CHAIN_REGNUM. These are the registers that cannot hold quantities
across calls even if we are willing to save and restore them. */
1991-11-06 00:39:50 +01:00
HARD_REG_SET call_fixed_reg_set;
/* Indexed by hard register number, contains 1 for registers
that are being used for global register decls.
These must be exempt from ordinary flow analysis
and are also considered fixed. */
char global_regs[FIRST_PSEUDO_REGISTER];
/* Contains 1 for registers that are set or clobbered by calls. */
/* ??? Ideally, this would be just call_used_regs plus global_regs, but
for someone's bright idea to have call_used_regs strictly include
fixed_regs. Which leaves us guessing as to the set of fixed_regs
that are actually preserved. We know for sure that those associated
with the local stack frame are safe, but scant others. */
HARD_REG_SET regs_invalidated_by_call;
/* Same information as REGS_INVALIDATED_BY_CALL but in regset form to be used
in dataflow more conveniently. */
regset regs_invalidated_by_call_regset;
/* The bitmap_obstack is used to hold some static variables that
should not be reset after each function is compiled. */
static bitmap_obstack persistent_obstack;
1991-11-06 00:39:50 +01:00
/* Table of register numbers in the order in which to try to use them. */
#ifdef REG_ALLOC_ORDER
int reg_alloc_order[FIRST_PSEUDO_REGISTER] = REG_ALLOC_ORDER;
/* The inverse of reg_alloc_order. */
int inv_reg_alloc_order[FIRST_PSEUDO_REGISTER];
1991-11-06 00:39:50 +01:00
#endif
/* For each reg class, a HARD_REG_SET saying which registers are in it. */
HARD_REG_SET reg_class_contents[N_REG_CLASSES];
/* The same information, but as an array of unsigned ints. We copy from
these unsigned ints to the table above. We do this so the tm.h files
do not have to be aware of the wordsize for machines with <= 64 regs.
Note that we hard-code 32 here, not HOST_BITS_PER_INT. */
#define N_REG_INTS \
((FIRST_PSEUDO_REGISTER + (32 - 1)) / 32)
static const unsigned int_reg_class_contents[N_REG_CLASSES][N_REG_INTS]
= REG_CLASS_CONTENTS;
1991-11-06 00:39:50 +01:00
/* For each reg class, number of regs it contains. */
* Rework fields used to describe positions of bitfields and modify sizes to be unsigned and use HOST_WIDE_INT. * alias.c (reg_known_value_size): Now unsigned. * c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position. (really_start_incremental_init): Use bitsize_zero_node. (push_init_level, pop_init_level, output_init_element): Likewise. Use bitsize_unit_node and bitsize_one_node. (output_pending_init_elements, process_init_element): Likewise. * combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned. (make_extraction): Position and length HOST_WIDE_INT and unsigned HOST_WIDE_INT, respectively. (get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT. (num_sign_bit_copies): Returns unsigned. BITWIDTH now unsigned; rework arithmetic. Remove recursive call from arg to MAX. (combine_instructions, init_reg_last_arrays): NREGS now unsigned. (setup_incoming_promotions, can_combine_p, try_combine, simplify_set): REGNO now unsigned. (set_nonzero_bit_and_sign_copies): NUM now unsigned. (find_split_point, expand_compound_operation, make_extraction): LEN now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT. (make_field_assignment): Likewise. (combine_simplify_rtx): Add cast. (expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic. (force_to_mode): WIDTH now unsigned; add cast. (if_then_else_cond): SIZE now unsigned. (nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned. (extended_count): Now returns unsigned. (simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT. Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned. (simplify_comparison): MODE_WIDTH now unsigned. (update_table_tick): REGNO and ENDREGNO now unsigned; new var R. (mark_used_regs_combine): Likewise; rework arithmetic. (record_value_for_reg): REGNO, ENDREGNO, and I now unsigned. (record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise. (record_promoted_value): REGNO now unsigned. (get_last_value_validate): REGNO, ENDREGNO, and J now unsigned. (get_last_value): REGNO now unsigned. (use_crosses_set_p): REGNO and ENDREGNO now unsigned. (reg_dead_regno, reg_dead_endregno): Now unsigned. (remove_death): Arg REGNO now unsigned. (move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned. (reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO now unsigned. * convert.c (convert_to_integer): INPREC and OUTPREC now unsigned. * cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned. (struct cse_reg_info): REGNO now unsigned. (cached_regno): Now unsigned. (REGNO_QTY_VALID_P): Add cast. (make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned. (remove_invalid_regs): Likewise. (remove_invalid_subreg_refs): Likewise; arg WORD also unsigned as are variables END and I. (get_cse_reg_info, insert): Likewise. (mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned. (canon_hash): Likewise. (insert_regs, lookup_for_remove): REGNO now unsigned. (invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned. New variable RN. * dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0. * dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast. * emit-rtl.c (subreg_realpart_p): Add cast. (operand_subword): Arg I is now unsigned as is var PARTWORDS. (operand_subword_force): Arg I is now unsigned. * except.c (eh_regs): Variable I is now unsigned. * explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT. * expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT; length is unsigned HOST_WIDE_INT; likewise for internal variables. (store_split_bit_field, extract_fixed_bit_field): Likewise. (extract_split_bit_field, store_bit_field, extract_bit_field): Likewise. * expr.c (store_constructor_fields, store_constructor, store_field): Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT. (expand_assignment, expand_expr, expand_expr_unaligned): Likewise. (do_jump): Likewise. (move_by_pieces, move_by_pieces_ninsns, clear_by_pieces): MAX_SIZE is now unsigned. (emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned. (emit_group_store): Likewise. (emit_move_insn): I now unsigned. (store_constructor): Use host_integerp, tree_low_cst, and bitsize_unit_node. (get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT. Rework all calculations to use trees and new fields. * expr.h (promoted_input_arg): Regno now unsigned. (store_bit_field, extract_bit_field): Adjust types of pos and size. (mark_seen_cases): Arg is HOST_WIDE_INT. * flow.c (verify_wide_reg_1): REGNO now unsigned. * fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT; precisions and alignments are unsigned. (optimize_bit_field_compare, fold_truthop): Likewise. (int_const_binop): Adjust threshold for size_int_type_wide call. (fold_convert): Likewise. (size_int_type_wide): Make table larger and fix thinko that only had half of table used. (all_ones_mask_p, fold): Precisions are unsigned. * function.c (put_reg_info_stack): REGNO is unsigned. (instantiate_decl): Size is HOST_WIDE_INT. (instantiate_virtual_regs): I is unsigned. (assign_parms): REGNO, REGNOI, and REGNOR are unsigned. (promoted_input_arg): REGNO is unsigned. * function.h (struct function): x_max_parm_reg is now unsigned. * gcse.c (max_gcse_regno): Now unsigned. (struct null_pointer_info): min_reg and max_reg now unsigned. (lookup_set, next_set): REGNO arg now unsigned. (compute_hash_table): REGNO and I now unsigned. (handle_avail_expr): regnum_for_replacing now unsigned. (cprop_insn): REGNO now unsigned. (delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned. * ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case. * global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned. * hard-reg-set.h (reg_class_size): Now unsigned. * integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO. * jump.c (mark_modified_reg): I now unsigned; add cast. (rtx_equal_for_thread_p): Add cast. * loop.c (max_reg_before_loop): Now unsigned. (struct_movable): REGNO now unsigned. (try_copy_prop): REGNO arg unsigned. (regs_match_p): XN and YN now unsigned. (consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned. (strength_reduce): Likewise; NREGS also unsigned. (first_increment_giv, last_increment_giv unsigned): Now unsigned. * loop.h (struct iv_class): REGNO now unsigned. (max_reg_before_loop, first_increment_giv, last_increment_giv): Now unsigned. * machmode.h (mode_size, mode_unit_size): Now unsigned. (mode_for_size, smallest_mode_for_size): Pass size as unsigned. * optabs.c (expand_binop): I and NWORDS now unsigned. (expand_unop): I now unsigned. * print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET. * real.c (significand_size): Now returns unsigned. * real.h (significand_size): Likewise. * regclass.c (reg_class_size): Now unsigned. (choose_hard_reg_mode): Both operands now unsigned. (record_reg_classes): REGNO and NR now unsigned. (reg_scan): NREGS now unsigned. (reg_scan_update): old_max_regno now unsigned. (reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned. * reload.c (find_valid_class): BEST_SIZE now unsigned. (find_dummy_reload): REGNO, NWORDS, and I now unsigned. (hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned. Likewise for variable R. (refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned, as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R. (find_equiv_reg): Add casts. (regno_clobbered_p): Arg REGNO now unsigned. * reload.h (struct reload): NREGS now unsigned. (refers_to_regno_for_reload_p): Regno args are unsigned. (regno_clobbered_p): Likewise. * reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned. (compute_use_by_pseudos): REGNO now unsigned. (find_reg): I and J now unsigned, new variable K, and change loop variables accordingly; THIS_NREGS now unsigned. (alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned. (spill_hard_reg): REGNO arg now unsigned; add casts. (forget_old_reloads_1): REGNO, NR, and I now unsigned. (mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned. (clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO, END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned. (reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned. (choose_reload_regs): MAX_GROUP_SIZE now unsigned. (emit_reload_insns): REGNO now unsigned. (reload_cse_move2add): Add cast. (move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO and rework loop. * resource.c (mark_referenced_resources, mark_set_resources): New variable R; REGNO and LAST_REGNO now unsigned. (mark_target_live_regs): J and REGNO now unsigned. * rtl.c (mode_size, mode_unit_size): Now unsigned. * rtl.h (union rtunion_def): New field rtuint. (XCUINT): New macro. (ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT. (operand_subword, operand_subword_force): Word number is unsigned. (choose_hard_reg_mode): Operands are unsigned. (refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned. (find_regno_note, find_regno_fusage, replace_regs): Likewise. (regno_use_in, combine_instructions, remove_death): Likewise. (reg_scan, reg_scan_update): Likewise. (extended_count): Return is unsigned. * rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I, INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO. (reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned. (reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned. (reg_reg_last_1): FIRS and LAST now unsigned. (dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned. (dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO now unsigned. (find_regno_note, regno_use_in): Arg REGNO now unsigned. (find_regno_fusage): Likewise; also var REGNOTE now unsigned. (find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned. (replace_regs): Arg NREGS now unsigned. * sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0. * simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned. (simplify_binary_operation): Likewise. (cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and THIS_LAST now unsigned. (cselib_record_set): Add cast. * ssa.c (ssa_max_reg_num): Now unsigned. (rename_block): REGNO now unsigned. * stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT; sizes now unsigned. (all_cases_count): Just return -1 not -2. COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT. Rework tests to use trees whenever possible. Use host_integerp and tree_low_cst. (mark_seen_cases): COUNT arg now HOST_WIDE_INT; Likewise variable NEXT_NODE_OFFSET; XLO now unsigned. (check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT. * stor-layout.c (mode_for_size): SIZE arg now unsigned. (smallest_mode_for_size): Likewise. (layout_decl): Simplify handing of a specified DECL_SIZE_UNIT. KNOWN_ALIGN is now an alignment, so simplify code. Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type. (start_record_layout): Renamed from new_record_layout_info. Update to new fields. (debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far): New functions. (place_union_field): Renamed from layout_union_field. Update to use new fields in rli. (place_field): Renamed from layout_field. Major rewrite to use new fields in rli; pass alignment to layout_decl. (finalize_record_size): Rework to use new fields in rli and handle union. (compute_record_mode): Rework to simplify and to use new DECL fields. (finalize_type_size): Make rounding more consistent. (finish_union_layout): Deleted. (layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either. (layout_type, case RECORD_TYPE): Call new function names. (initialize_sizetypes): Set TYPE_IS_SIZETYPE. (set_sizetype): Set TYPE_IS_SIZETYPE earlier. (get_best_mode): UNIT is now unsigned; remove casts. * tree.c (bit_position): Compute from new fields. (byte_position, int_byte_position): New functions. (print_type_hash_statistics): Cast to remove warning. (build_range_type): Use host_integerp and tree_low_cst to try to hash. (build_index_type): Likewise; make subtype of sizetype. (build_index_2_type): Pass sizetype to build_range_type. (build_common_tree_nodes): Use size_int and bitsize_int to initialize nodes; add bitsize_{zero,one,unit}_node. * tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK. (DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise. (DECL_PACKED, DECL_BIT_FIELD): Likewise. (DECL_FIELD_BITPOS): Deleted. (DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields. (DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK. (DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise. (DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise. (DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise. (DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise. (DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise. (DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK. (DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK. (DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise. (DECL_ALIGN): Adjust to new field in union. (DECL_OFFSET_ALIGN): New field. (DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK. (DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK. (union tree_decl): Add struct for both aligns. (enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}. (bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added. (struct record_layout_info): Rework fields to have offset alignment and byte and bit position. (start_record_layout, place_field): Renamed from old names. (rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls. (byte_position, int_byte_position): Likewise. (get_inner_reference): Change types of position and length. * unroll.c (unroll_loop): New variable R; use for some loops. MAX_LOCAL_REGNUM and MAXREGNUM now unsigned. (calculate_giv_inc): Arg REGNO now unsigned. (copy_loop_body): REGNO and SRC_REGNO now unsigned. * varasm.c (assemble_variable): Clean up handling of size using host_integerp and tree_low_cst. (decode_addr_const): Use byte, not bit, position. (output_constructor): bitpos and offsets are HOST_WIDE_INT; use tree_low_cst and int_bit_position. * objc/objc-act.c (build_ivar_list_initializer): Use byte_position. * ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT. * ch/typeck.c (expand_constant_to_buffer): Use int_byte_position. (extract_constant_from_buffer): Likewise. * cp/class.c (build_vbase_pointer_fields): layout_field now place_field. (get_vfield_offset): Use byte_position. (set_rtti_entry): Set OFFSET to ssizetype zero. (get_binfo_offset_as_int): Deleted. (dfs_record_base_offsets): Use tree_low_cst. (dfs_search_base_offsets): Likewise. (layout_nonempty_base_or_field): Reflect changes in RLI format and call byte_position. (layout_empty_base): Convert offset to ssizetype. (build_base_field): use rli_size_unit_so_far. (dfs_propagate_binfo_offsets): Do computation in proper type. (layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets. (layout_class_type): Reflect changes in RLI names and fields. (finish_struct_1): Set DECL_FIELD_OFFSET. * cp/dump.c (dequeue_and_dump): Call bit_position. * cp/expr.c (cplus_expand_constant): Use byte_position. * cp/rtti.c (expand_class_desc): Use bitsize_one_node. * cp/typeck.c (build_component_addr): Use byte_position and don't special case for zero offset. * f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node. (ffecom_tree_canonize_ref_): Likewise. * java/class.c (make_field_value): Use byte_position. * java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position. (java_array_data_offset): Likewise. * java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to bzero call. From-SVN: r32742
2000-03-25 19:34:13 +01:00
unsigned int reg_class_size[N_REG_CLASSES];
1991-11-06 00:39:50 +01:00
/* For each reg class, table listing all the classes contained in it. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
enum reg_class reg_class_subclasses[N_REG_CLASSES][N_REG_CLASSES];
1991-11-06 00:39:50 +01:00
/* For each pair of reg classes,
a largest reg class contained in their union. */
enum reg_class reg_class_subunion[N_REG_CLASSES][N_REG_CLASSES];
/* For each pair of reg classes,
the smallest reg class containing their union. */
enum reg_class reg_class_superunion[N_REG_CLASSES][N_REG_CLASSES];
Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o with min-insn-modes.o. * Makefile.in (BUILD_RTL): Replace $(BUILD_PREFIX)insn-modes.o with min-insn-modes.o. (STAGESTUFF): Add min-insn-modes.c. (genobjs): Add genmodes.o. (print-rtl.o, print-rtl1.o): Depend on $(TM_P_H). (insn-modes.o): Depend on $(TM_H) not $(GTM_H); also real.h. (min-insn-modes.c, min-insn-modes.o): New rules. (s-modes): Also generate min-insn-modes.c. ($(BUILD_PREFIX_1)insn-modes.o): Kill. * genmodes.c (struct mode_data): Add format field. (blank_mode, validate_mode, complete_mode): Update to match. (make_scalar_mode): Separate into make_int_mode and make_float_mode. (_SCALAR_MODE): Kill. (FLOAT_MODE, FRACTIONAL_FLOAT_MODE): Add format argument. (emit_insn_modes_c_header): Adjust. (emit_min_insn_modes_c_header, emit_real_format_for_mode) (emit_min_insn_modes_c): New functions. (emit_insn_modes_c): Call emit_real_format_for_mode. (main): Add -m option to generate min-insn-modes.c. * machmode.h: Update documentation. Add format argument to all uses of FLOAT_MODE. * real.c: Don't define real_format_for_mode here. * dwarfout.c: Move default definition of PRINT_REG... * defaults.h: ...here. * print-rtl.c: Include tm_p.h. (DEBUG_PRINT_REG, DEBUG_REGISTER_NAMES, debug_reg_names, reg_names): Kill. (print_rtx): Use PRINT_REG, not DEBUG_PRINT_REG. But surround this entire block with #ifndef GENERATOR_FILE. * regclass.c: Unconditionally define reg_names. * config/mips/mips.h, config/rs6000/rs6000.h, config/sh/sh.h Don't define DEBUG_REGISTER_NAMES. * config/rs6000/darwin.h: Don't use DEBUG_REGISTER_NAMES in redefinition of REGISTER_NAMES. * config/i386/i386.h: Don't define DEBUG_PRINT_REG. * combine.c: Change all preprocessor conditionals on EXTRA_CC_MODES to use SELECT_CC_MODE instead; rearrange a bit for clarity. * genopinit.c: Remove mention of EXTRA_CC_MODES in comment. * configure.in: Don't define EXTRA_CC_MODES. * configure, config.in: Regenerate. * doc/tm.texi: Remove documentation of EXTRA_CC_MODES. * config/arc/arc.c, config/m32r/m32r.c, config/sparc/sparc.c: May assume that GET_MODE_CLASS is accurate for extra CC modes at all times. * config/i860/i860.h (INIT_CUMULATIVE_ARGS): Pass correct number of arguments to aggregate_value_p. * genmodes.c (RESET_FLOAT_FORMAT, reset_float_format): New. * machmode.def: Explain ARCH-modes.def. Document RESET_FLOAT_FORMAT. Improve commentary on various mode clusters. Do not define OI, PQI, PHI, PSI, PDI, QF, HF, TQF, XF, or TF modes here. Remove backward-compatibility definition of CC. * config/alpha/alpha-modes.def: New file; define TF mode. * config/arc/arm-modes.def: Define XF mode. * config/c4x/c4x-modes.def: Define QF and HF modes. Unset float format for SF and DF modes. * config/dsp16xx/dsp16xx-modes.def: New file; define HF mode. * config/i386/i386-modes.def: Define XF and TF modes. * config/i960/i960-modes.def: Define TF mode. * config/ia64/ia64-modes.def: Define TF and OI modes. * config/m68k/m68k-modes.def: New file; define XF mode. * config/mips/mips-modes.def: New file; define TF mode, reset formats for SF and DF modes. * config/pa/pa-modes.def: Define TF mode. * config/rs6000/rs6000.c: Define TF and PSI modes. * config/s390/s390-modes.def: Define OI mode. * config/sh/sh-modes.def: New file; define PSI mode. * config/sparc/sparc-modes.def: Define TF mode. * config/vax/vax-modes.def: New file; reset formats for SF and DF modes. * config/c4x/c4x.c (c4x_override_options): No need to mess with real_format_for_mode or set REAL_MODE_FORMATs. (c4x_immed_int_constant): Don't apply GET_MODE_CLASS to rtx variable. * config/i386/i386.c (override_options): No need to set REAL_MODE_FORMATs here. * config/i960/i960.c (i960_initialize): Likewise. * config/m68k/m68k.c (m68k_override_options): Likewise. * config/ia64/ia64.c (ia64_override_options): Set REAL_MODE_FORMAT for TFmode only if not the default. * config/mips/mips.c (override_options): Likewise. * config/vax/vax.c (override_optionms): Set REAL_MODE_FORMAT for DFmode only if not the default. * config/i370/i370.h (RET_REG): Don't consider TFmode. * config/m68hc11/m68hc11.c (print_operand): Don't consider XFmode. * config/dsp16xx/dsp16xx.c (hard_regno_mode_ok): #if 0 out use of modes that don't appear anywhere in the machine description. * config/arc/arc-modes.def, config/arm/arm-modes.def * config/c4x/c4x-modes.def, config/frv/frv-modes.def * config/i386/i386-modes.def, config/i960/i960-modes.def * config/ia64/ia64-modes.def, config/mmix/mmix-modes.def * config/pa/pa-modes.def, config/pdp11/pdp11-modes.def * config/rs6000/rs6000-modes.def, config/s390/s390-modes.def * config/sparc/sparc-modes.def: Convert to new style for declaring extra CC modes. From-SVN: r72440
2003-10-13 23:16:33 +02:00
/* Array containing all of the register names. */
const char * reg_names[] = REGISTER_NAMES;
/* Array containing all of the register class names. */
const char * reg_class_names[] = REG_CLASS_NAMES;
/* For each hard register, the widest mode object that it can contain.
This will be a MODE_INT mode if the register can hold integers. Otherwise
it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
register. */
enum machine_mode reg_raw_mode[FIRST_PSEUDO_REGISTER];
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
/* 1 if there is a register of given mode. */
bool have_regs_of_mode [MAX_MACHINE_MODE];
/* 1 if class does contain register of given mode. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
char contains_reg_of_mode [N_REG_CLASSES] [MAX_MACHINE_MODE];
/* Maximum cost of moving from a register in one class to a register in
another class. Based on REGISTER_MOVE_COST. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
move_table *move_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a subset
of the second so in that case the cost is zero. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
move_table *may_move_in_cost[MAX_MACHINE_MODE];
/* Similar, but here we don't have to move if the first index is a superset
of the second so in that case the cost is zero. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
move_table *may_move_out_cost[MAX_MACHINE_MODE];
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Keep track of the last mode we initialized move costs for. */
static int last_mode_for_init_move_cost;
/* Sample MEM values for use by memory_move_secondary_cost. */
static GTY(()) rtx top_of_stack[MAX_MACHINE_MODE];
/* No more global register variables may be declared; true once
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
reginfo has been initialized. */
static int no_global_reg_vars = 0;
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
/* Specify number of hard registers given machine mode occupy. */
unsigned char hard_regno_nregs[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
/* Given a register bitmap, turn on the bits in a HARD_REG_SET that
correspond to the hard registers, if any, set in that map. This
could be done far more efficiently by having all sorts of special-cases
with moving single words, but probably isn't worth the trouble. */
void
alias.c (rtx_equal_for_memref_p): Constify. * alias.c (rtx_equal_for_memref_p): Constify. * basic-block.h (const_edge, const_basic_block): New. (reg_set_to_hard_reg_set, dfs_enumerate_from, single_succ_p, single_pred_p, single_succ_edge, single_pred_edge, single_succ, single_pred, maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p, edge_probability_reliable_p, br_prob_note_reliable_p, forwarder_block_p, flow_nodes_print, inside_basic_block_p, control_flow_insn_p, dominated_by_p): Likewise. * bb-reorder.c (better_edge_p, push_to_next_round_p): Likewise. * bt-load.c (basic_block_freq, insn_sets_btr_p, can_move_up): Likewise. * cfganal.c (flow_active_insn_p, forwarder_block_p, flow_nodes_print, dfs_enumerate_from): Likewise. * cfgbuild.c (count_basic_blocks, inside_basic_block_p, control_flow_insn_p, count_basic_blocks): Likewise. * cfgloop.c (flow_bb_inside_loop_p, glb_enum_p, get_loop_body_with_size, loop_exit_edge_p): Likewise. * cfgloop.h (flow_bb_inside_loop_p, num_loop_insns, average_num_loop_insns, loop_exit_edge_p, just_once_each_iteration_p, can_duplicate_loop_p): Likewise. * cfgloopanal.c (just_once_each_iteration_p, num_loop_insns, average_num_loop_insns, seq_cost): Likewise. * cfgloopmanip.c (rpe_enum_p, can_duplicate_loop_p): Likewise. * dominance.c (dominated_by_p): Likewise. * emit-rtl.c (validate_subreg): Likewise. * except.c (can_throw_internal, can_throw_external): Likewise. * except.h (can_throw_internal, can_throw_external): Likewise. * gcse.c (gcse_constant_p, oprs_unchanged_p, oprs_anticipatable_p, oprs_available_p, hash_expr, expr_equiv_p, oprs_not_set_p, compute_transp, load_killed_in_block_p, reg_killed_on_edge, simple_mem, store_ops_ok, load_kills_store, find_loads, store_killed_in_insn, store_killed_after, store_killed_before, gcse_mem_operand, implicit_set_cond_p, store_killed_in_pat): Likewise. * ifcvt.c (count_bb_insns, cheap_bb_rtx_cost_p, noce_operand_ok, noce_mem_write_may_trap_or_fault_p): Likewise. * pointer-set.c (pointer_set_contains, pointer_map_contains): Likewise. * pointer-set.h (pointer_set_contains, pointer_map_contains): Likewise. * predict.c (can_predict_insn_p, maybe_hot_bb_p, probably_cold_bb_p, probably_never_executed_bb_p, edge_probability_reliable_p, br_prob_note_reliable_p, can_predict_insn_p): Likewise. * regclass.c (reg_set_to_hard_reg_set): Likewise. * resource.c (return_insn_p): Likewise. * rtl.h (reg_set_between_p, reg_set_p, validate_subreg): Likewise. * rtlanal.c (reg_set_between_p, reg_set_p): Likewise. * tracer.c (count_insns, ignore_bb_p, better_p): Likewise. * tree-cfg.c (verify_gimple_unary_expr, verify_gimple_binary_expr, verify_gimple_modify_stmt): Likewise. * tree-chrec.c (is_not_constant_evolution, is_multivariate_chrec_rec, is_multivariate_chrec, chrec_contains_symbols, chrec_contains_undetermined, tree_contains_chrecs, evolution_function_is_affine_multivariate_p, evolution_function_is_univariate_p, avoid_arithmetics_in_type_p, eq_evolutions_p, scev_direction): Likewise. * tree-chrec.h (automatically_generated_chrec_p, tree_is_chrec, eq_evolutions_p, is_multivariate_chrec, chrec_contains_symbols, chrec_contains_symbols_defined_in_loop, chrec_contains_undetermined, tree_contains_chrecs, evolution_function_is_affine_multivariate_p, evolution_function_is_univariate_p, chrec_zerop, evolution_function_is_constant_p, evolution_function_is_affine_p, evolution_function_is_affine_or_constant_p, tree_does_not_contain_chrecs, chrec_type): Likewise. * tree-data-ref.c (tree_fold_divides_p, object_address_invariant_in_loop_p, dr_may_alias_p, ziv_subscript_p, siv_subscript_p, gcd_of_steps_may_divide_p, same_access_functions, constant_access_functions, access_functions_are_affine_or_constant_p, find_vertex_for_stmt): Likewise. * tree-flow.h (scev_direction): Likewise. * tree-gimple.c (is_gimple_stmt): Likewise. * tree-outof-ssa.c (identical_copies_p, identical_stmt_lists_p): Likewise. * tree-pretty-print.c (op_prio): Likewise. * tree-scalar-evolution.c (chrec_contains_symbols_defined_in_loop, analyzable_condition, backedge_phi_arg_p): Likewise. * tree-scalar-evolution.h (get_chrec_loop): Likewise. * tree-ssa-operands.c (get_name_decl, operand_build_cmp): Likewise. * tree-ssa-threadupdate.c (dbds_continue_enumeration_p): Likewise. From-SVN: r127404
2007-08-14 06:44:35 +02:00
reg_set_to_hard_reg_set (HARD_REG_SET *to, const_bitmap from)
{
unsigned i;
bitmap_iterator bi;
EXECUTE_IF_SET_IN_BITMAP (from, 0, i, bi)
{
if (i >= FIRST_PSEUDO_REGISTER)
return;
SET_HARD_REG_BIT (*to, i);
}
}
1991-11-06 00:39:50 +01:00
/* Function called only once to initialize the above data on reg usage.
Once this is done, various switches may override. */
void
init_reg_sets (void)
1991-11-06 00:39:50 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int i, j;
1991-11-06 00:39:50 +01:00
/* First copy the register information from the initial int form into
the regsets. */
for (i = 0; i < N_REG_CLASSES; i++)
{
CLEAR_HARD_REG_SET (reg_class_contents[i]);
/* Note that we hard-code 32 here, not HOST_BITS_PER_INT. */
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (int_reg_class_contents[i][j / 32]
& ((unsigned) 1 << (j % 32)))
SET_HARD_REG_BIT (reg_class_contents[i], j);
}
/* Sanity check: make sure the target macros FIXED_REGISTERS and
CALL_USED_REGISTERS had the right number of initializers. */
gcc_assert (sizeof fixed_regs == sizeof initial_fixed_regs);
gcc_assert (sizeof call_used_regs == sizeof initial_call_used_regs);
1991-11-06 00:39:50 +01:00
memcpy (fixed_regs, initial_fixed_regs, sizeof fixed_regs);
memcpy (call_used_regs, initial_call_used_regs, sizeof call_used_regs);
memset (global_regs, 0, sizeof global_regs);
}
/* Initialize may_move_cost and friends for mode M. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
void
init_move_cost (enum machine_mode m)
{
static unsigned short last_move_cost[N_REG_CLASSES][N_REG_CLASSES];
bool all_match = true;
unsigned int i, j;
gcc_assert (have_regs_of_mode[m]);
for (i = 0; i < N_REG_CLASSES; i++)
if (contains_reg_of_mode[i][m])
for (j = 0; j < N_REG_CLASSES; j++)
{
int cost;
if (!contains_reg_of_mode[j][m])
cost = 65535;
else
{
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
cost = REGISTER_MOVE_COST (m, (enum reg_class) i,
(enum reg_class) j);
gcc_assert (cost < 65535);
}
all_match &= (last_move_cost[i][j] == cost);
last_move_cost[i][j] = cost;
}
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
if (all_match && last_mode_for_init_move_cost != -1)
{
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
move_cost[m] = move_cost[last_mode_for_init_move_cost];
may_move_in_cost[m] = may_move_in_cost[last_mode_for_init_move_cost];
may_move_out_cost[m] = may_move_out_cost[last_mode_for_init_move_cost];
return;
}
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
last_mode_for_init_move_cost = m;
move_cost[m] = (move_table *)xmalloc (sizeof (move_table)
* N_REG_CLASSES);
may_move_in_cost[m] = (move_table *)xmalloc (sizeof (move_table)
* N_REG_CLASSES);
may_move_out_cost[m] = (move_table *)xmalloc (sizeof (move_table)
* N_REG_CLASSES);
for (i = 0; i < N_REG_CLASSES; i++)
if (contains_reg_of_mode[i][m])
for (j = 0; j < N_REG_CLASSES; j++)
{
int cost;
enum reg_class *p1, *p2;
if (last_move_cost[i][j] == 65535)
{
move_cost[m][i][j] = 65535;
may_move_in_cost[m][i][j] = 65535;
may_move_out_cost[m][i][j] = 65535;
}
else
{
cost = last_move_cost[i][j];
for (p2 = &reg_class_subclasses[j][0];
*p2 != LIM_REG_CLASSES; p2++)
if (*p2 != i && contains_reg_of_mode[*p2][m])
cost = MAX (cost, move_cost[m][i][*p2]);
for (p1 = &reg_class_subclasses[i][0];
*p1 != LIM_REG_CLASSES; p1++)
if (*p1 != j && contains_reg_of_mode[*p1][m])
cost = MAX (cost, move_cost[m][*p1][j]);
gcc_assert (cost <= 65535);
move_cost[m][i][j] = cost;
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
if (reg_class_subset_p ((enum reg_class) i, (enum reg_class) j))
may_move_in_cost[m][i][j] = 0;
else
may_move_in_cost[m][i][j] = cost;
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
if (reg_class_subset_p ((enum reg_class) j, (enum reg_class) i))
may_move_out_cost[m][i][j] = 0;
else
may_move_out_cost[m][i][j] = cost;
}
}
else
for (j = 0; j < N_REG_CLASSES; j++)
{
move_cost[m][i][j] = 65535;
may_move_in_cost[m][i][j] = 65535;
may_move_out_cost[m][i][j] = 65535;
}
}
/* We need to save copies of some of the register information which
can be munged by command-line switches so we can restore it during
subsequent back-end reinitialization. */
static char saved_fixed_regs[FIRST_PSEUDO_REGISTER];
static char saved_call_used_regs[FIRST_PSEUDO_REGISTER];
#ifdef CALL_REALLY_USED_REGISTERS
static char saved_call_really_used_regs[FIRST_PSEUDO_REGISTER];
#endif
static const char *saved_reg_names[FIRST_PSEUDO_REGISTER];
/* Save the register information. */
void
save_register_info (void)
{
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Sanity check: make sure the target macros FIXED_REGISTERS and
CALL_USED_REGISTERS had the right number of initializers. */
gcc_assert (sizeof fixed_regs == sizeof saved_fixed_regs);
gcc_assert (sizeof call_used_regs == sizeof saved_call_used_regs);
memcpy (saved_fixed_regs, fixed_regs, sizeof fixed_regs);
memcpy (saved_call_used_regs, call_used_regs, sizeof call_used_regs);
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Likewise for call_really_used_regs. */
#ifdef CALL_REALLY_USED_REGISTERS
gcc_assert (sizeof call_really_used_regs
== sizeof saved_call_really_used_regs);
memcpy (saved_call_really_used_regs, call_really_used_regs,
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
sizeof call_really_used_regs);
#endif
/* And similarly for reg_names. */
gcc_assert (sizeof reg_names == sizeof saved_reg_names);
memcpy (saved_reg_names, reg_names, sizeof reg_names);
}
/* Restore the register information. */
static void
restore_register_info (void)
{
memcpy (fixed_regs, saved_fixed_regs, sizeof fixed_regs);
memcpy (call_used_regs, saved_call_used_regs, sizeof call_used_regs);
#ifdef CALL_REALLY_USED_REGISTERS
memcpy (call_really_used_regs, saved_call_really_used_regs,
sizeof call_really_used_regs);
#endif
memcpy (reg_names, saved_reg_names, sizeof reg_names);
}
/* After switches have been processed, which perhaps alter
`fixed_regs' and `call_used_regs', convert them to HARD_REG_SETs. */
static void
init_reg_sets_1 (void)
{
unsigned int i, j;
unsigned int /* enum machine_mode */ m;
restore_register_info ();
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
#ifdef REG_ALLOC_ORDER
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
inv_reg_alloc_order[reg_alloc_order[i]] = i;
#endif
/* This macro allows the fixed or call-used registers
and the register classes to depend on target flags. */
#ifdef CONDITIONAL_REGISTER_USAGE
CONDITIONAL_REGISTER_USAGE;
#endif
1991-11-06 00:39:50 +01:00
/* Compute number of hard regs in each class. */
memset (reg_class_size, 0, sizeof reg_class_size);
1991-11-06 00:39:50 +01:00
for (i = 0; i < N_REG_CLASSES; i++)
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
if (TEST_HARD_REG_BIT (reg_class_contents[i], j))
reg_class_size[i]++;
/* Initialize the table of subunions.
reg_class_subunion[I][J] gets the largest-numbered reg-class
that is contained in the union of classes I and J. */
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
memset (reg_class_subunion, 0, sizeof reg_class_subunion);
1991-11-06 00:39:50 +01:00
for (i = 0; i < N_REG_CLASSES; i++)
{
for (j = 0; j < N_REG_CLASSES; j++)
{
HARD_REG_SET c;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int k;
1991-11-06 00:39:50 +01:00
COPY_HARD_REG_SET (c, reg_class_contents[i]);
IOR_HARD_REG_SET (c, reg_class_contents[j]);
for (k = 0; k < N_REG_CLASSES; k++)
if (hard_reg_set_subset_p (reg_class_contents[k], c)
&& !hard_reg_set_subset_p (reg_class_contents[k],
reg_class_contents
[(int) reg_class_subunion[i][j]]))
1991-11-06 00:39:50 +01:00
reg_class_subunion[i][j] = (enum reg_class) k;
}
}
/* Initialize the table of superunions.
reg_class_superunion[I][J] gets the smallest-numbered reg-class
containing the union of classes I and J. */
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
memset (reg_class_superunion, 0, sizeof reg_class_superunion);
1991-11-06 00:39:50 +01:00
for (i = 0; i < N_REG_CLASSES; i++)
{
for (j = 0; j < N_REG_CLASSES; j++)
{
HARD_REG_SET c;
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int k;
1991-11-06 00:39:50 +01:00
COPY_HARD_REG_SET (c, reg_class_contents[i]);
IOR_HARD_REG_SET (c, reg_class_contents[j]);
for (k = 0; k < N_REG_CLASSES; k++)
if (hard_reg_set_subset_p (c, reg_class_contents[k]))
break;
1991-11-06 00:39:50 +01:00
reg_class_superunion[i][j] = (enum reg_class) k;
}
}
/* Initialize the tables of subclasses and superclasses of each reg class.
First clear the whole table, then add the elements as they are found. */
for (i = 0; i < N_REG_CLASSES; i++)
{
for (j = 0; j < N_REG_CLASSES; j++)
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
reg_class_subclasses[i][j] = LIM_REG_CLASSES;
1991-11-06 00:39:50 +01:00
}
for (i = 0; i < N_REG_CLASSES; i++)
{
if (i == (int) NO_REGS)
continue;
for (j = i + 1; j < N_REG_CLASSES; j++)
if (hard_reg_set_subset_p (reg_class_contents[i],
reg_class_contents[j]))
{
/* Reg class I is a subclass of J.
Add J to the table of superclasses of I. */
enum reg_class *p;
/* Add I to the table of superclasses of J. */
p = &reg_class_subclasses[j][0];
while (*p != LIM_REG_CLASSES) p++;
*p = (enum reg_class) i;
}
1991-11-06 00:39:50 +01:00
}
1991-11-06 00:39:50 +01:00
/* Initialize "constant" tables. */
CLEAR_HARD_REG_SET (fixed_reg_set);
CLEAR_HARD_REG_SET (call_used_reg_set);
CLEAR_HARD_REG_SET (call_fixed_reg_set);
CLEAR_HARD_REG_SET (regs_invalidated_by_call);
if (!regs_invalidated_by_call_regset)
{
bitmap_obstack_initialize (&persistent_obstack);
regs_invalidated_by_call_regset = ALLOC_REG_SET (&persistent_obstack);
}
else
CLEAR_REG_SET (regs_invalidated_by_call_regset);
1991-11-06 00:39:50 +01:00
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
/* call_used_regs must include fixed_regs. */
ra-build.c (copy_insn_p, [...]): Use gcc_assert and gcc_unreachable instead of abort. * ra-build.c (copy_insn_p, remember_move, defuse_overlap_p_1, live_out_1, prune_hardregs_for_mode, init_one_web_common, reinit_one_web, add_subweb, add_subweb_2, init_web_parts, record_conflict, compare_and_free_webs, init_webs_defs_uses, parts_to_webs_1, parts_to_webs, reset_conflicts, check_conflict_numbers, remember_web_was_spilled, handle_asm_insn, ra_build_free): Use gcc_assert and gcc_unreachable instead of abort. * ra-colorize.c (push_list, put_web, reset_lists, put_web_at_end, put_move, remove_move, combine, select_spill, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias, restore_conflicts_from_coalesce, sort_and_combine_web_pairs, check_uncoalesced_moves): Likewise. * ra-rewrite.c (spill_coalescing, slots_overlap_p, emit_loads, reloads_to_loads, rewrite_program2, emit_colors): Likewise. * ra.c (first_hard_reg, create_insn_info, find_subweb, init_ra, check_df): Likewise. * real.c (do_add, do_multiply, do_divide, do_compare, do_fix_trunc, real_arithmetic, real_compare, real_exponent, real_ldexp, real_identical, real_to_integer, real_to_integer2, real_to_decimal, real_to_hexadecimal, real_from_integer, ten_to_ptwo, ten_to_mptwo, real_digit, real_nan, real_maxval, round_for_format, real_convert, real_to_target, real_from_target, real_hash, encode_ieee_single, encode_ieee_double, encode_ieee_extended, encode_ieee_quad, encode_vax_f, encode_vax_d, encode_vax_g, encode_i370_single, encode_i370_double, encode_c4x_single, encode_c4x_extended): Likewise. * recog.c (validate_change, validate_replace_rtx_1, asm_operand_ok, extract_insn, peep2_next_insn, peep2_reg_dead_p, peep2_find_free_register, peephole2_optimize, store_data_bypass_p, if_test_bypass_p): Likewise. * reg-stack.c (record_label_references, get_asm_operand_n_inputs, stack_result, remove_regno_note, get_hard_regnum, emit_pop_insn, emit_swap_insn, swap_to_top, move_for_stack_reg, subst_stack_regs_pat, subst_asm_stack_regs, change_stack, compensate_edge, convert_regs_1): Likewise. * regclass.c (init_reg_sets, init_reg_sets_1, memory_move_secondary_cost): Likewise. * regrename.c (note_sets, clear_dead_regs, scan_rtx_reg, scan_rtx): Likewise. * reload.c (push_secondary_reload, find_valid_class, push_reload, operands_match_p, decompose, immune_p, find_reloads, find_reloads_toplev, find_reloads_address_1, subst_reloads, copy_replacements, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (compute_use_by_pseudos, replace_pseudos_in, reload, count_pseudo, find_reg, eliminate_regs, eliminate_regs_in_insn, verify_initial_elim_offsets, finish_spills, clear_reload_reg_in_use, reload_reg_free_p, reload_reg_reaches_end_p, reloads_conflict, choose_reload_regs, merge_assigned_reloads, emit_input_reload_insns, do_output_reload, fixup_abnormal_edges): Likewise. * reorg.c (stop_search_p, emit_delay_sequence, get_jump_flags, fill_slots_from_thread, relax_delay_slots): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtl.c (copy_rtx, rtx_equal_p): Likewise. * rtlanal.c (insn_dependent_p, reg_overlap_mentioned_p, dead_or_set_p, find_reg_fusage, remove_note, replace_rtx, subreg_lsb_1, subreg_regno_offset, subreg_offset_representable_p, find_first_parameter_load, can_hoist_insn_p, hoist_update_store, hoist_insn_after, hoist_insn_to_edge, nonzero_bits1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sbitmap.c (sbitmap_difference): Likewise. * sched-deps.c (add_dependence, sched_analyze_1, sched_analyze_2, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, schedule_ebb): Likewise. * sched-rgn.c (debug_regions, compute_trg_info, schedule_region, schedule_insns): Likewise. * sched-vis.c (print_pattern): Likewise. * sdbout.c (sdbout_symbol, sdbout_toplevel_data): Likewise. * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_ternary_operation, simplify_immed_subreg, simplify_subreg, simplify_gen_subreg): Likewise. * sreal.c (copy, sreal_sub, sreal_div): Likewise. * stmt.c (force_label_rtx, expand_goto, expand_asm_operands, resolve_operand_name_1, expand_return, expand_decl, expand_anon_union_decl, emit_case_bit_tests, expand_case): Likewise. * stor-layout.c (put_pending_size, smallest_mode_for_size, int_mode_for_mode, layout_decl, finish_builtin_struct, layout_type, set_sizetype, get_mode_bounds): Likewise. From-SVN: r87244
2004-09-09 19:19:16 +02:00
gcc_assert (!fixed_regs[i] || call_used_regs[i]);
#ifdef CALL_REALLY_USED_REGISTERS
/* call_used_regs must include call_really_used_regs. */
ra-build.c (copy_insn_p, [...]): Use gcc_assert and gcc_unreachable instead of abort. * ra-build.c (copy_insn_p, remember_move, defuse_overlap_p_1, live_out_1, prune_hardregs_for_mode, init_one_web_common, reinit_one_web, add_subweb, add_subweb_2, init_web_parts, record_conflict, compare_and_free_webs, init_webs_defs_uses, parts_to_webs_1, parts_to_webs, reset_conflicts, check_conflict_numbers, remember_web_was_spilled, handle_asm_insn, ra_build_free): Use gcc_assert and gcc_unreachable instead of abort. * ra-colorize.c (push_list, put_web, reset_lists, put_web_at_end, put_move, remove_move, combine, select_spill, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias, restore_conflicts_from_coalesce, sort_and_combine_web_pairs, check_uncoalesced_moves): Likewise. * ra-rewrite.c (spill_coalescing, slots_overlap_p, emit_loads, reloads_to_loads, rewrite_program2, emit_colors): Likewise. * ra.c (first_hard_reg, create_insn_info, find_subweb, init_ra, check_df): Likewise. * real.c (do_add, do_multiply, do_divide, do_compare, do_fix_trunc, real_arithmetic, real_compare, real_exponent, real_ldexp, real_identical, real_to_integer, real_to_integer2, real_to_decimal, real_to_hexadecimal, real_from_integer, ten_to_ptwo, ten_to_mptwo, real_digit, real_nan, real_maxval, round_for_format, real_convert, real_to_target, real_from_target, real_hash, encode_ieee_single, encode_ieee_double, encode_ieee_extended, encode_ieee_quad, encode_vax_f, encode_vax_d, encode_vax_g, encode_i370_single, encode_i370_double, encode_c4x_single, encode_c4x_extended): Likewise. * recog.c (validate_change, validate_replace_rtx_1, asm_operand_ok, extract_insn, peep2_next_insn, peep2_reg_dead_p, peep2_find_free_register, peephole2_optimize, store_data_bypass_p, if_test_bypass_p): Likewise. * reg-stack.c (record_label_references, get_asm_operand_n_inputs, stack_result, remove_regno_note, get_hard_regnum, emit_pop_insn, emit_swap_insn, swap_to_top, move_for_stack_reg, subst_stack_regs_pat, subst_asm_stack_regs, change_stack, compensate_edge, convert_regs_1): Likewise. * regclass.c (init_reg_sets, init_reg_sets_1, memory_move_secondary_cost): Likewise. * regrename.c (note_sets, clear_dead_regs, scan_rtx_reg, scan_rtx): Likewise. * reload.c (push_secondary_reload, find_valid_class, push_reload, operands_match_p, decompose, immune_p, find_reloads, find_reloads_toplev, find_reloads_address_1, subst_reloads, copy_replacements, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (compute_use_by_pseudos, replace_pseudos_in, reload, count_pseudo, find_reg, eliminate_regs, eliminate_regs_in_insn, verify_initial_elim_offsets, finish_spills, clear_reload_reg_in_use, reload_reg_free_p, reload_reg_reaches_end_p, reloads_conflict, choose_reload_regs, merge_assigned_reloads, emit_input_reload_insns, do_output_reload, fixup_abnormal_edges): Likewise. * reorg.c (stop_search_p, emit_delay_sequence, get_jump_flags, fill_slots_from_thread, relax_delay_slots): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtl.c (copy_rtx, rtx_equal_p): Likewise. * rtlanal.c (insn_dependent_p, reg_overlap_mentioned_p, dead_or_set_p, find_reg_fusage, remove_note, replace_rtx, subreg_lsb_1, subreg_regno_offset, subreg_offset_representable_p, find_first_parameter_load, can_hoist_insn_p, hoist_update_store, hoist_insn_after, hoist_insn_to_edge, nonzero_bits1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sbitmap.c (sbitmap_difference): Likewise. * sched-deps.c (add_dependence, sched_analyze_1, sched_analyze_2, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, schedule_ebb): Likewise. * sched-rgn.c (debug_regions, compute_trg_info, schedule_region, schedule_insns): Likewise. * sched-vis.c (print_pattern): Likewise. * sdbout.c (sdbout_symbol, sdbout_toplevel_data): Likewise. * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_ternary_operation, simplify_immed_subreg, simplify_subreg, simplify_gen_subreg): Likewise. * sreal.c (copy, sreal_sub, sreal_div): Likewise. * stmt.c (force_label_rtx, expand_goto, expand_asm_operands, resolve_operand_name_1, expand_return, expand_decl, expand_anon_union_decl, emit_case_bit_tests, expand_case): Likewise. * stor-layout.c (put_pending_size, smallest_mode_for_size, int_mode_for_mode, layout_decl, finish_builtin_struct, layout_type, set_sizetype, get_mode_bounds): Likewise. From-SVN: r87244
2004-09-09 19:19:16 +02:00
gcc_assert (!call_really_used_regs[i] || call_used_regs[i]);
#endif
1991-11-06 00:39:50 +01:00
if (fixed_regs[i])
SET_HARD_REG_BIT (fixed_reg_set, i);
if (call_used_regs[i])
SET_HARD_REG_BIT (call_used_reg_set, i);
/* There are a couple of fixed registers that we know are safe to
exclude from being clobbered by calls:
The frame pointer is always preserved across calls. The arg pointer
is if it is fixed. The stack pointer usually is, unless
RETURN_POPS_ARGS, in which case an explicit CLOBBER will be present.
If we are generating PIC code, the PIC offset table register is
preserved across calls, though the target can override that. */
if (i == STACK_POINTER_REGNUM)
;
else if (global_regs[i])
{
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
}
else if (i == FRAME_POINTER_REGNUM)
;
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
else if (i == HARD_FRAME_POINTER_REGNUM)
;
#endif
#if ARG_POINTER_REGNUM != FRAME_POINTER_REGNUM
else if (i == ARG_POINTER_REGNUM && fixed_regs[i])
;
#endif
#ifndef PIC_OFFSET_TABLE_REG_CALL_CLOBBERED
else if (i == (unsigned) PIC_OFFSET_TABLE_REGNUM && fixed_regs[i])
;
#endif
else if (CALL_REALLY_USED_REGNO_P (i))
{
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
}
1991-11-06 00:39:50 +01:00
}
COPY_HARD_REG_SET(call_fixed_reg_set, fixed_reg_set);
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Preserve global registers if called more than once. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
if (global_regs[i])
{
fixed_regs[i] = call_used_regs[i] = 1;
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
SET_HARD_REG_BIT (fixed_reg_set, i);
SET_HARD_REG_BIT (call_used_reg_set, i);
SET_HARD_REG_BIT (call_fixed_reg_set, i);
}
}
tree-cfg.c (gimplify_val): Move from tree-complex.c. 2004-07-22 Paolo Bonzini <bonzini@gnu.org> * tree-cfg.c (gimplify_val): Move from tree-complex.c. (gimplify_build1): Move from tree-complex.c do_unop. (gimplify_build2): Move from tree-complex.c do_binop. (gimplify_build3): New. * tree-complex.c (gimplify_val, do_unop, do_binop): Remove. Adjust throughout to call the functions above. * tree-flow.h: Declare the functions above. * tree-nested.c (gimplify_val): Rename to... (tsi_gimplify_val): ... this. * Makefile.in (tree_complex.o): Update dependencies. (stor-layout.o): Depend on regs.h. * c-common.c (handle_vector_size_attribute): Update for vector types without corresponding vector modes. * expr.c (expand_expr): Treat VECTOR_CST's like CONSTRUCTORS if a corresponding vector mode is not available. * print-tree.c (print_node): Print nunits for vector types * regclass.c (have_regs_of_mode): New. (init_reg_sets_1): Initialize it and use it instead of allocatable_regs_of_mode. * regs.h (have_regs_of_mode): Declare it. * stor-layout.c (layout_type): Pick a mode for vector types. * tree-complex.c (build_word_mode_vector_type, tree_vec_extract, build_replicated_const, do_unop, do_binop, do_plus_minus, do_negate, expand_vector_piecewise, expand_vector_parallel, expand_vector_addition, expand_vector_operations_1, expand_vector_operations, tree_lower_operations, pass_lower_vector_ssa, pass_pre_expand): New. (expand_complex_operations, pass_lower_complex): Remove. * tree-optimize.c (init_tree_optimization_passes): Adjust pass ordering for changes in tree-complex.c. * tree-pass.h: Declare new passes. * tree.c (finish_vector_type): Remove. (make_vector_type): New. (build_vector_type_for_mode, build_vector_type): Rewritten. * tree.def (VECTOR_TYPE): Document where the number of subparts is stored. * tree.h (TYPE_VECTOR_SUBPARTS): Use TYPE_PRECISION field. (make_vector): Remove declaration. From-SVN: r85039
2004-07-22 10:20:40 +02:00
memset (have_regs_of_mode, 0, sizeof (have_regs_of_mode));
memset (contains_reg_of_mode, 0, sizeof (contains_reg_of_mode));
print-rtl.c (print_rtx): Cast enums to int for comparison. * print-rtl.c (print_rtx): Cast enums to int for comparison. * c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. From-SVN: r40193
2001-03-02 22:41:37 +01:00
for (m = 0; m < (unsigned int) MAX_MACHINE_MODE; m++)
{
HARD_REG_SET ok_regs;
CLEAR_HARD_REG_SET (ok_regs);
for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
if (!fixed_regs [j] && HARD_REGNO_MODE_OK (j, (enum machine_mode) m))
SET_HARD_REG_BIT (ok_regs, j);
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
for (i = 0; i < N_REG_CLASSES; i++)
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
if (((unsigned) CLASS_MAX_NREGS ((enum reg_class) i,
(enum machine_mode) m)
<= reg_class_size[i])
&& hard_reg_set_intersect_p (ok_regs, reg_class_contents[i]))
{
contains_reg_of_mode [i][m] = 1;
have_regs_of_mode [m] = 1;
}
}
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Reset move_cost and friends, making sure we only free shared
table entries once. */
for (i = 0; i < MAX_MACHINE_MODE; i++)
if (move_cost[i])
{
for (j = 0; j < i && move_cost[i] != move_cost[j]; j++)
;
if (i == j)
{
free (move_cost[i]);
free (may_move_in_cost[i]);
free (may_move_out_cost[i]);
}
}
memset (move_cost, 0, sizeof move_cost);
memset (may_move_in_cost, 0, sizeof may_move_in_cost);
memset (may_move_out_cost, 0, sizeof may_move_out_cost);
last_mode_for_init_move_cost = -1;
}
/* Compute the table of register modes.
These values are used to record death information for individual registers
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
(as opposed to a multi-register mode).
This function might be invoked more than once, if the target has support
for changing register usage conventions on a per-function basis.
*/
void
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
init_reg_modes_target (void)
{
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
int i, j;
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
for (j = 0; j < MAX_MACHINE_MODE; j++)
hard_regno_nregs[i][j] = HARD_REGNO_NREGS(i, (enum machine_mode)j);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
reg_raw_mode[i] = choose_hard_reg_mode (i, 1, false);
/* If we couldn't find a valid mode, just use the previous mode.
??? One situation in which we need to do this is on the mips where
HARD_REGNO_NREGS (fpreg, [SD]Fmode) returns 2. Ideally we'd like
to use DF mode for the even registers and VOIDmode for the odd
1995-05-16 14:39:54 +02:00
(for the cpu models where the odd ones are inaccessible). */
if (reg_raw_mode[i] == VOIDmode)
reg_raw_mode[i] = i == 0 ? word_mode : reg_raw_mode[i-1];
}
}
Separate target-specific initialization from general back-end initialization. 2007-08-27 Sandra Loosemore <sandra@codesourcery.com> David Ung <davidu@mips.com> Nigel Stephens <nigel@mips.com> gcc/ Separate target-specific initialization from general back-end initialization. * toplev.c (init_alignments): New, split out from... (process_options): ...here. (backend_init_target): New, split out from... (backend_init): ...here. (lang_dependent_init_target): New, split out from... (lang_dependent_init): ...here. (target_reinit): New. * toplev.h (target_reinit): Declare. * expr.c (init_expr_target): Renamed from init_expr_once, since it now can be called more than once. Update comments. * expr.h (init_expr_target): Likewise. * alias.c (init_alias_target): Renamed from init_alias_once, since it now can be called more than once. Explicitly zero static_reg_base_value. * emit-rtl.c (init_emit_regs): New, split out from... (init_emit_once): Here. * regclass.c (initial_fixed_regs, initial_call_used_regs): Make non-const, so that changes from command-line arguments can overwrite values provided by the static initializers. (initial_call_really_used_regs): New, used similarly to the above. (initial_reg_names): Likewise. (last_mode_for_init_move_cost): Promoted function-local static to file-scope static to make it accessible outside init_move_cost. (init_reg_sets): Do not initialize fixed_regs and call_used_regs yet. Do not initialize inv_reg_alloc_order yet, either. Do initialize reg_names since it is needed for parsing command-line options. (init_move_cost): Use last_mode_for_init_move_cost instead of function-local static. (init_reg_sets_1): Initialize fixed_regs, call_used_regs, and call_really_used_regs now. Reinitialize reg_names. Also initialize inv_reg_alloc_order. Zero reg_class_subunion and reg_class_superunion. Clear losing_caller_save_reg_set. Preserve global registers if called more than once. Reset move cost, may_move_in_cost, may_move_out_cost, and last_mode_for_init_move_cost. (init_reg_modes_target): Renamed from init_reg_modes_once, since it can now be invoked more than once. Update comments. (init_regs): Update comments. (fix_register): Update initial_fixed_regs, initial_call_used_regs, and initial_call_really_used_regs, instead of the non-initial variables. This allows us to save the command-line register settings after target reinitialization. (init_reg_autoinc): Zero forbidden_inc_dec_classes. * rtl.h (init_emit_regs): Declare. (init_reg_modes_target, init_alias_target): Renamed as described above. * reload1.c (init_reload): Update comments. * optabs.c (init_optabs): Likewise. * cfgloopanal.c (init_set_costs): Explicitly zero target_avail_regs. Co-Authored-By: David Ung <davidu@mips.com> Co-Authored-By: Nigel Stephens <nigel@mips.com> From-SVN: r127832
2007-08-27 15:34:14 +02:00
/* Finish initializing the register sets and initialize the register modes.
This function might be invoked more than once, if the target has support
for changing register usage conventions on a per-function basis.
*/
void
init_regs (void)
{
/* This finishes what was started by init_reg_sets, but couldn't be done
until after register usage was specified. */
init_reg_sets_1 ();
}
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
/* The same as previous function plus initializing IRA. */
void
reinit_regs (void)
{
init_regs ();
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
ira_init ();
}
/* Initialize some fake stack-frame MEM references for use in
memory_move_secondary_cost. */
void
init_fake_stack_mems (void)
{
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
int i;
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
for (i = 0; i < MAX_MACHINE_MODE; i++)
Fix enum conversions which are invalid in C++: gcc/: Fix enum conversions which are invalid in C++: * auto-inc-dec.c (attempt_change): Change 0 to SET in function call. * calls.c (store_one_arg): Change 0 to EXPAND_NORMAL in function call. * cse.c (hash_rtx_cb): Change 0 to VOIDmode in function call. * dbgcnt.c (dbg_cnt_set_limit_by_name): Add cast to enum type. * dbxout.c (dbxout_symbol): Change 0 to VOIDmode in function call. (dbxout_parms): Likewise. * df-core.c (df_set_flags): Change changeable_flags parameter to int. (df_clear_flags): Likewise. * df-problems.c (df_rd_bb_local_compute_process_def): Change top_flag parameter to int. (df_chain_create_bb_process_use): Likewise. (df_chain_add_problem): Change chain_flags parameter to unsigned int. Remove cast. * df-scan.c (df_ref_create): Change ref_flags parameter to int. (df_ref_create_structure, df_def_record_1): Likewise. (df_defs_record, df_uses_record, df_get_call_refs): Likewise. (df_notes_rescan): Change 0 to VOIDmode in function call. (df_get_call_refs, df_insn_refs_collect): Likewise. (df_bb_regs_collect): Likewise. (df_entry_block_defs_collect): Likewise. (df_exit_block_uses_collect): Likewise. * df.h: Update declarations. * double-int.c (double_int_divmod): Add cast to enum type. * dse.c (replace_inc_dec): Reverse parameters to gen_int_mode. * dwarf2out.c (new_reg_loc_descr): Add casts to enum type. (based_loc_descr): Likewise. (loc_descriptor_from_tree_1): Change first_op and second_op to enum dwarf_location_atom. Add cast to enum type. * expmed.c (init_expmed): Change 0 to SET in function call. * expr.c (init_expr_target): Change 0 to VOIDmode in function call. (expand_expr_real_1): Change 0 to EXPAND_NORMAL in function call. (do_store_flag): Likewise. * fixed-value.h (struct fixed_value): Change mode to enum machine_mode. * function.c (assign_parms): Change 0 to VOIDmode in function call. * genautomata.c (insert_automaton_decl): Change 1 to INSERT in function call. (insert_insn_decl, insert_decl, insert_state): Likewise. (automata_list_finish): Likewise. * genrecog.c (process_define_predicate): Add cast to enum type. * gensupport.c (init_predicate_table): Add cast to enum type. * gimple.c (gimple_build_return): Change 0 to ERROR_MARK in function call. (gimple_build_call_1, gimple_build_label): Likewise. (gimple_build_goto, gimple_build_asm_1): Likewise. (gimple_build_switch_1, gimple_build_cdt): Likewise. * gimple.h (GIMPLE_CHECK): Change 0 to ERROR_MARK in function call. (enum fallback): Rename from enum fallback_t. (fallback_t): Typedef as int. * gimple-low.c (lower_builtin_setjmp): Change TSI_SAME_STMT to GSI_SAME_STMT in function call. * ira.c (setup_class_subset_and_memory_move_costs): Add casts to enum type. (setup_reg_class_relations): Likewise. (setup_reg_class_nregs): Change cl to int. Add casts to enum type. (setup_prohibited_class_mode_regs): Add cast to enum type. (setup_prohibited_mode_move_regs): Likewise. * ira-costs.c (record_reg_classes): Change rclass to enum reg_class. (record_address_regs): Change i to enum reg_class. * lists.c (alloc_EXPR_LIST): Add cast to enum type. * machmode.h (GET_MODE_CLASS): Cast value to enum mode_class. (GET_MODE_WIDER_MODE): Cast value to enum machine_mode. (GET_MODE_2XWIDER_MODE): Likewise. (GET_CLASS_NARROWEST_MODE): Likewise. * omp-low.c (expand_omp_for): Add cast to enum type. * optabs.c (debug_optab_libfuncs): Add casts to enum type. * opts.c (enable_warning_as_error): Change kind to diagostic_t. * postreload.c (reload_cse_simplify_operands): Change rclass local to enum reg_class. * predict.c (combine_predictions_for_insn): Change best_predictor and predictor to enum br_predictor. (combine_predictions_for_bb): Likewise. (build_predict_expr): Change assignment to PREDICT_EXPR_OUTCOME to use SET_PREDICT_EXPR_OUTCOME. * real.c (real_arithmetic): Change icode to code in function call. * reginfo.c (init_move_cost): Add casts to enum type. (init_reg_sets_1, init_fake_stack_mems): Likewise. * regmove.c (regclass_compatible_p): Change class0 and class1 to enum reg_class. * reload.c (find_valid_class): Add casts to enum type. (push_reload): Change 0 to NO_REGS in function call. (find_reloads): Change this_alternative to array of enum reg_class. Remove some now-unnecessary casts. (make_memloc): Change 0 to VOIDmode in function call. * reload1.c (reload): Change 0 to VOIDmode in function call. (eliminate_regs_1, elimination_effects): Likewise. (eliminate_regs_in_insn): Likewise. (emit_input_reload_insns): Add cast to enum type. (delete_output_reload): Change 0 to VOIDmode in function call. * reorg.c (insn_sets_resource_p): Convert include_delayed_effects to enum type in function call. * tree.h (PREDICT_EXPR_OUTCOME): Add cast to enum type. (SET_PREDICT_EXPR_OUTCOME): Define. * tree-dump.c (get_dump_file_info): Change phase parameter to int. (get_dump_file_name, dump_begin, dump_enabled_p): Likewise. (dump_initialized_p, dump_flag_name, dump_end): Likewise. (dump_function): Likewise. * tree-dump.h: Update declarations. * tree-pass.h: Update declarations. * varasm.c (assemble_integer): Change mclass to enum mode_class. * config/arm/arm.c (thumb_legitimize_reload_address): Add cast to enum type. (arm_rtx_costs_1): Correct parenthesization. (arm_rtx_costs): Add casts to enum type. (adjacent_mem_locations): Reverse arguments to const_ok_for_op. (vfp_emit_fstmd): Use add_rg_note. (emit_multi_reg_push, emit_sfm): Likewise. (thumb_set_frame_pointer): Likewise. (arm_expand_prologue): Likewise. (arm_regno_class): Change return type to enum reg_class. (thumb1_expand_prologue): Use add_reg_note. * config/arm/arm-protos.h (arm_regno_class): Update declaration. * config/arm/arm.h (INITIALIZE_TRAMPOLINE): Change 0 to LCT_NORMAL in function call. * config/arm/gentune.sh: Add cast to enum type. * config/arm/arm-tune.md: Rebuild. * config/i386/i386.c (ix86_expand_prologue): Use add_reg_note. (ix86_split_fp_branch, predict_jump): Likewise. (ix86_expand_multi_arg_builtin): Change sub_code from enum insn_code to enum rtx_code. (ix86_builtin_vectorized_function): Add cast to enum type. * config/i386/i386.md (truncdfsf2): Change slot to enum ix86_stack_slot. (truncxf<mode>2, isinf<mode>2): Likewise. * config/i386/i386-c.c (ix86_pragma_target_parse): Add cast to enum type. * config/ia64/ia64.c (ia64_split_tmode_move): Use add_reg_note. (spill_restore_mem, do_spill, ia64_expand_prologue): Likewise. (insert_bundle_state): Change 1 to INSERT in function call. (ia64_add_bundle_selector_before): Likewise. * config/ia64/ia64.md (cpu attr): Add cast to enum type. (save_stack_nonlocal): Change 0 to LCT_NORMAL in function call. (restore_stack_nonlocal): Likewise. * config/mips/mips.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/mips/mips.c (mips_binary_cost): Change 0 to SET in function call. (mips_rtx_costs): Likewise. (mips_override_options): Add casts to enum type. * config/mips/sdemtk.h (MIPS_ICACHE_SYNC): Change 0 to LCT_NORMAL in function call. * config/pa/pa.c (legitimize_pic_address): Use add_reg_note. (store_reg, set_reg_plus_d): Likewise. (hppa_expand_prologue, hppa_profile_hook): Likewise. * config/rs6000/rs6000.c (rs6000_init_hard_regno_mode_ok): Add cast to enum type. (altivec_expand_vec_set_builtin): Change 0 to EXPAND_NORMAL in function call. (emit_unlikely_jump): Use add_reg_note. (rs6000_emit_allocate_stack): Likewise. (rs6000_frame_related, rs6000_emit_prologue): Likewise. (output_toc): Change 1 to INSERT in function call. (output_profile_hook): Change 0 to LCT_NORMAL in function call. (rs6000_initialize_trampoline): Likewise. (rs6000_init_dwarf_reg_sizes_extra): Change 0 to EXPAND_NORMAL in function call. * config/s390/s390.c (s390_rtx_costs): Add cast to enum type. (s390_expand_movmem): Change 0 to OPTAB_DIRECT in function call. (s390_expand_setmem, s390_expand_cmpmem): Likewise. (save_gprs): Use add_reg_note. (s390_emit_prologue): Likewise. (s390_expand_builtin): Change 0 to EXPAND_NORMAL in function call. * config/sparc/sparc.c (sparc_expand_prologue): Use add_reg_note. (sparc_fold_builtin): Add cast to enum type. * config/spu/spu.c (spu_emit_branch_or_set): Change ior_code to enum insn_code. (spu_expand_prologue): Use add_reg_note. (expand_builtin_args): Change 0 to EXPAND_NORMAL in function call. * c-parser.c (c_parser_attributes): Change VEC back to tree list. (c_parser_postfix_expression_after_primary): Get VEC for list of arguments. Get original types of arguments. Call build_function_call_vec. (cached_expr_list_1, cached_expr_list_2): New static variables. (c_parser_expr_list): Change return type to VEC *. Add p_orig_types parameter. Change all callers. (c_parser_release_expr): New static function. (c_parser_vec_to_tree_list): New static function. * c-typeck.c (build_function_call): Rewrite to build a VEC and call build_function_call_vec. (build_function_call_vec): New function, based on old build_function_call. (convert_arguments): Remove nargs and argarray parameters. Change values to a VEC. Add origtypes parameter. (build_modify_expr): Add rhs_origtype parameter. Change all callers. (convert_for_assignment): Add origtype parameter. Change all callers. If warn_cxx_compat, check for conversion to an enum type when calling a function. (store_init_value): Add origtype parameter. Change all callers. (digest_init): Likewise. (struct init_node): Add origtype field. (add_pending_init): Add origtype parameter. Change all callers. (output_init_element): Likewise. (output_pending_init_elements): Pass origtype from init_node to output_init_element. (process_init_elemnt): Pass origtype from c_expr to output_init_element. (c_finish_return): Add origtype parameter. Change all callers. * c-common.c (sync_resolve_size): Change params to VEC *. Change caller. (sync_resolve_params): Likewise. (sync_resolve_return): Change params to first_param. Change caller. (resolve_overloaded_builtins): Change params to VEC *. Change callers. Save first parameter around call to build_function_call_vec. * c-decl.c (finish_decl): Add origtype parameter. Change all callers. Call build_function_call_vec rather than build_function_call for cleanup. * c-tree.h: Update declarations. * c-common.h: Update declarations. * stub-objc.c (objc_rewrite_function_call): Change parameter from params to first_param. * target.h (struct gcc_target): Change resolve_overloaded_builtin params parameter from tree to void *. * config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin): Change arglist parameter to have type void *, and to be a pointer to a VEC. * config/rs6000/rs6000-protos.h (altivec_resolve_overloaded_builtin): Update declaration. * config/spu/spu-c.c (spu_resolved_overloaded_builtin): Change fnargs parameter to have type void *, and to be a pointer to a VEC. Call build_function_call_vec instead of build_function_call. * config/spu/spu-protos.h (spu_expand_builtin): Update declaration. gcc/cp/: * typeck.c (build_function_call_vec): New function. (cp_build_function_call): Only pass first parameter to objc_rewrite_function_call. (build_modify_expr): Add rhs_origtype parameter. Change all callers. * decl.c (finish_decl): Add origtype parameter. Change all callers. * semantics.c (finish_call_expr): Pass VEC to resolve_overloaded_builtin. gcc/objc: * objc-act.c (objc_rewrite_function_call): Change parameter from params to first_param. Change all callers. gcc/testsuite: * gcc.dg/Wcxx-compat-3.c: New testcase. From-SVN: r146451
2009-04-20 21:35:00 +02:00
top_of_stack[i] = gen_rtx_MEM ((enum machine_mode) i, stack_pointer_rtx);
}
/* Compute extra cost of moving registers to/from memory due to reloads.
Only needed if secondary reloads are required for memory moves. */
int
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
memory_move_secondary_cost (enum machine_mode mode, enum reg_class rclass,
int in)
{
enum reg_class altclass;
int partial_cost = 0;
/* We need a memory reference to feed to SECONDARY... macros. */
/* mem may be unused even if the SECONDARY_ macros are defined. */
Makefile.in (toplev.o): Depend on loop.h. * Makefile.in (toplev.o): Depend on loop.h. * dwarfout.c: Include tm_p.h. * emit-rtl.c (restore_emit_status): Mark parameter with ATTRIBUTE_UNUSED. * final.c (final_scan_insn): Likewise. * flow.c (flow_nodes_print, flow_exits_print, flow_loops_cfg_dump, flow_loop_nested_p, flow_loop_exits_find, flow_loop_nodes_find, flow_depth_first_order_compute, flow_loop_pre_header_find, flow_loop_tree_node_add, flow_loops_tree_build, flow_loop_level_compute, flow_loops_level_compute, flow_loop_outside_edge_p): Add prototypes. (recompute_reg_usage): Mark parameters with ATTRIBUTE_UNUSED. * ggc-callbacks.c (lang_mark_tree, lang_mark_false_label_stack): Mark with ATTRIBUTE_NORETURN. * hash.c (hash_newfunc): Mark parameter with ATTRIBUTE_UNUSED. * local-alloc.c (no_conflict_p): Likewise. * loop.c (insert_bct): Hide definitions of variables with hidden usage. (note_reg_stored): Mark parameter with ATTRIBUTE_UNUSED. * regclass.c (memory_move_secondary_cost): Mark variable `mem' with ATTRIBUTE_UNUSED. (record_reg_classes): Mark parameter with ATTRIBUTE_UNUSED. (reg_scan): Likewise. * reload.c (find_reloads): Remove unused variables `changed'. * reload1.c (reload_reg_class_lower): Don't unnecessarily cast away const-ness. (allocate_reload_reg): Mark parameter with ATTRIBUTE_UNUSED. Remove unused variable `insn'. * toplev.c: Include loop.h. (report_file_and_line): Remove unnecessary prototype. * tree.c (build_block): Mark parameter with ATTRIBUTE_UNUSED. * unroll.c (biv_total_increment): Likewise. From-SVN: r31085
1999-12-24 15:04:54 +01:00
rtx mem ATTRIBUTE_UNUSED = top_of_stack[(int) mode];
altclass = secondary_reload_class (in ? 1 : 0, rclass, mode, mem);
if (altclass == NO_REGS)
return 0;
if (in)
partial_cost = REGISTER_MOVE_COST (mode, altclass, rclass);
else
partial_cost = REGISTER_MOVE_COST (mode, rclass, altclass);
if (rclass == altclass)
/* This isn't simply a copy-to-temporary situation. Can't guess
what it is, so MEMORY_MOVE_COST really ought not to be calling
here in that case.
ra-build.c (copy_insn_p, [...]): Use gcc_assert and gcc_unreachable instead of abort. * ra-build.c (copy_insn_p, remember_move, defuse_overlap_p_1, live_out_1, prune_hardregs_for_mode, init_one_web_common, reinit_one_web, add_subweb, add_subweb_2, init_web_parts, record_conflict, compare_and_free_webs, init_webs_defs_uses, parts_to_webs_1, parts_to_webs, reset_conflicts, check_conflict_numbers, remember_web_was_spilled, handle_asm_insn, ra_build_free): Use gcc_assert and gcc_unreachable instead of abort. * ra-colorize.c (push_list, put_web, reset_lists, put_web_at_end, put_move, remove_move, combine, select_spill, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias, restore_conflicts_from_coalesce, sort_and_combine_web_pairs, check_uncoalesced_moves): Likewise. * ra-rewrite.c (spill_coalescing, slots_overlap_p, emit_loads, reloads_to_loads, rewrite_program2, emit_colors): Likewise. * ra.c (first_hard_reg, create_insn_info, find_subweb, init_ra, check_df): Likewise. * real.c (do_add, do_multiply, do_divide, do_compare, do_fix_trunc, real_arithmetic, real_compare, real_exponent, real_ldexp, real_identical, real_to_integer, real_to_integer2, real_to_decimal, real_to_hexadecimal, real_from_integer, ten_to_ptwo, ten_to_mptwo, real_digit, real_nan, real_maxval, round_for_format, real_convert, real_to_target, real_from_target, real_hash, encode_ieee_single, encode_ieee_double, encode_ieee_extended, encode_ieee_quad, encode_vax_f, encode_vax_d, encode_vax_g, encode_i370_single, encode_i370_double, encode_c4x_single, encode_c4x_extended): Likewise. * recog.c (validate_change, validate_replace_rtx_1, asm_operand_ok, extract_insn, peep2_next_insn, peep2_reg_dead_p, peep2_find_free_register, peephole2_optimize, store_data_bypass_p, if_test_bypass_p): Likewise. * reg-stack.c (record_label_references, get_asm_operand_n_inputs, stack_result, remove_regno_note, get_hard_regnum, emit_pop_insn, emit_swap_insn, swap_to_top, move_for_stack_reg, subst_stack_regs_pat, subst_asm_stack_regs, change_stack, compensate_edge, convert_regs_1): Likewise. * regclass.c (init_reg_sets, init_reg_sets_1, memory_move_secondary_cost): Likewise. * regrename.c (note_sets, clear_dead_regs, scan_rtx_reg, scan_rtx): Likewise. * reload.c (push_secondary_reload, find_valid_class, push_reload, operands_match_p, decompose, immune_p, find_reloads, find_reloads_toplev, find_reloads_address_1, subst_reloads, copy_replacements, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p): Likewise. * reload1.c (compute_use_by_pseudos, replace_pseudos_in, reload, count_pseudo, find_reg, eliminate_regs, eliminate_regs_in_insn, verify_initial_elim_offsets, finish_spills, clear_reload_reg_in_use, reload_reg_free_p, reload_reg_reaches_end_p, reloads_conflict, choose_reload_regs, merge_assigned_reloads, emit_input_reload_insns, do_output_reload, fixup_abnormal_edges): Likewise. * reorg.c (stop_search_p, emit_delay_sequence, get_jump_flags, fill_slots_from_thread, relax_delay_slots): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtl.c (copy_rtx, rtx_equal_p): Likewise. * rtlanal.c (insn_dependent_p, reg_overlap_mentioned_p, dead_or_set_p, find_reg_fusage, remove_note, replace_rtx, subreg_lsb_1, subreg_regno_offset, subreg_offset_representable_p, find_first_parameter_load, can_hoist_insn_p, hoist_update_store, hoist_insn_after, hoist_insn_to_edge, nonzero_bits1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sbitmap.c (sbitmap_difference): Likewise. * sched-deps.c (add_dependence, sched_analyze_1, sched_analyze_2, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, schedule_ebb): Likewise. * sched-rgn.c (debug_regions, compute_trg_info, schedule_region, schedule_insns): Likewise. * sched-vis.c (print_pattern): Likewise. * sdbout.c (sdbout_symbol, sdbout_toplevel_data): Likewise. * simplify-rtx.c (simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_ternary_operation, simplify_immed_subreg, simplify_subreg, simplify_gen_subreg): Likewise. * sreal.c (copy, sreal_sub, sreal_div): Likewise. * stmt.c (force_label_rtx, expand_goto, expand_asm_operands, resolve_operand_name_1, expand_return, expand_decl, expand_anon_union_decl, emit_case_bit_tests, expand_case): Likewise. * stor-layout.c (put_pending_size, smallest_mode_for_size, int_mode_for_mode, layout_decl, finish_builtin_struct, layout_type, set_sizetype, get_mode_bounds): Likewise. From-SVN: r87244
2004-09-09 19:19:16 +02:00
I'm tempted to put in an assert here, but returning this will
probably only give poor estimates, which is what we would've
had before this code anyways. */
return partial_cost;
/* Check if the secondary reload register will also need a
secondary reload. */
return memory_move_secondary_cost (mode, altclass, in) + partial_cost;
}
/* Return a machine mode that is legitimate for hard reg REGNO and large
enough to save nregs. If we can't find one, return VOIDmode.
If CALL_SAVED is true, only consider modes that are call saved. */
enum machine_mode
choose_hard_reg_mode (unsigned int regno ATTRIBUTE_UNUSED,
unsigned int nregs, bool call_saved)
{
print-rtl.c (print_rtx): Cast enums to int for comparison. * print-rtl.c (print_rtx): Cast enums to int for comparison. * c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. From-SVN: r40193
2001-03-02 22:41:37 +01:00
unsigned int /* enum machine_mode */ m;
enum machine_mode found_mode = VOIDmode, mode;
/* We first look for the largest integer mode that can be validly
held in REGNO. If none, we look for the largest floating-point mode.
If we still didn't find a valid mode, try CCmode. */
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
return found_mode;
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
return found_mode;
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_FLOAT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
return found_mode;
for (mode = GET_CLASS_NARROWEST_MODE (MODE_VECTOR_INT);
mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
found_mode = mode;
if (found_mode != VOIDmode)
return found_mode;
/* Iterate over all of the CCmodes. */
print-rtl.c (print_rtx): Cast enums to int for comparison. * print-rtl.c (print_rtx): Cast enums to int for comparison. * c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. From-SVN: r40193
2001-03-02 22:41:37 +01:00
for (m = (unsigned int) CCmode; m < (unsigned int) NUM_MACHINE_MODES; ++m)
{
mode = (enum machine_mode) m;
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
if ((unsigned) hard_regno_nregs[regno][mode] == nregs
&& HARD_REGNO_MODE_OK (regno, mode)
&& (! call_saved || ! HARD_REGNO_CALL_PART_CLOBBERED (regno, mode)))
print-rtl.c (print_rtx): Cast enums to int for comparison. * print-rtl.c (print_rtx): Cast enums to int for comparison. * c-decl.c (grokdeclarator): Cast enums to int for comparison and shifts. * c-format.c (C_STD_VER): Cast to int for comparisons. (check_function_format): Cast various enums to int for &. (maybe_read_dollar_number): Likewise. (check_format_info): Likewise. (check_format_info_main): Likewise. * expr.c (emit_move_insn_1): Cast enums to unsigned int for comparison. (safe_from_p): Likewise. * varasm.c (const_hash): Cast enum to int for %. * emit-rtl.c (init_emit_once): Use int loop variable to work around pcc enum problems with < and ++ operators. * regclass.c (init_reg_sets_1): Cast enums for comparison. (choose_hard_reg_mode): Use unsigned int to iterate over CCmodes. (regclass_init): Change enum class to int to iterate over reg_classes. * genrecog.c (merge_trees): Cast enums for comparison. * rtl.h (GET_CODE): Cast to enum rtx_code. (PUT_CODE): Cast to ENUM_BITFIELD(rtx_code). (GET_MODE): Cast to enum machine_mode. (PUT_MODE): Cast to ENUM_BITFIELD(machine_mode). (GET_NOTE_INSN_NAME): Cast enum to int. * tree.h (TREE_CODE): Cast to enum tree_code. (TREE_SET_CODE): Cast VALUE to ENUM_BITFIELD(tree_code). * timevar.c (timevar_print): Change loop variable id from enum to unsigned int. * fixinc/fixincl.c (VLEVEL): Cast enums in comparison to unsigned int. * config/i386/i386.md: Use PUT_MODE for mode assignment. * toplev.c (compile_file): Cast enum DFI to int. (decode_d_option): Likewise. From-SVN: r40193
2001-03-02 22:41:37 +01:00
return mode;
}
/* We can't find a mode valid for this register. */
return VOIDmode;
1991-11-06 00:39:50 +01:00
}
/* Specify the usage characteristics of the register named NAME.
It should be a fixed register if FIXED and a
call-used register if CALL_USED. */
void
fix_register (const char *name, int fixed, int call_used)
1991-11-06 00:39:50 +01:00
{
int i;
/* Decode the name and update the primary form of
the register info. */
if ((i = decode_reg_name (name)) >= 0)
{
if ((i == STACK_POINTER_REGNUM
#ifdef HARD_FRAME_POINTER_REGNUM
|| i == HARD_FRAME_POINTER_REGNUM
#else
|| i == FRAME_POINTER_REGNUM
#endif
)
&& (fixed == 0 || call_used == 0))
{
rtl.h (rtx_format): Constify a char*. * rtl.h (rtx_format): Constify a char*. * rtl.c (rtx_format): Likewise. (copy_rtx, copy_most_rtx, read_rtx): Likewise. (init_rtl): Use accessor macro, not `rtx_format'. * alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a char*. * caller-save.c (mark_referenced_regs): Likewise. * combine.c (subst, make_compound_operation, known_cond, gen_rtx_combine, update_table_tick, get_last_value_validate, use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise. * cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p, refers_to_p, canon_reg, fold_rtx, cse_process_notes, count_reg_usage): Likewise. * emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags): Likewise. * final.c (leaf_renumber_regs_insn): Likewise. * flow.c (mark_used_regs, find_use_as_address, dump_flow_info, dump_edge_info, count_reg_references): Likewise. * function.c (fixup_var_refs_1, walk_fixup_memory_subreg, fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1): Likewise. * gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p, oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs, add_label_notes): Likewise. * genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask, clear_struct_flag, count_sub_rtxs, count_alternatives, compares_alternatives_p, contained_in_p, walk_attr_value, write_expr_attr_cache): Likewise. * genconfig.c (walk_insn_part): Likewise. * genemit.c (max_operand_1, gen_exp): Likewise. * genextract.c (walk_rtx): Likewise. * genflags.c (num_operands): Likewise. * genoutput.c (scan_operands): Likewise. * genpeep.c (match_rtx): Likewise. * genrecog.c (add_to_sequence): Likewise. * haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths): Likewise. * integrate.c (save_constants, copy_for_inline, copy_rtx_and_substitute, subst_constants, restore_constants): Likewise. * jump.c (mark_jump_label, invert_exp, redirect_exp, rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise. * local-alloc.c (contains_replace_regs, memref_referenced_p): Likewise. * loop.c (record_excess_regs, rtx_equal_for_loop_p, add_label_notes, replace_call_address, count_nonfixed_reads, invariant_p, find_single_use_in_loop, find_mem_givs, find_life_end, maybe_eliminate_biv_1, update_reg_last_use): Likewise. * print-rtl.c (reg_names, print_rtx): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1): Likewise. * reg-stack.c (stack_regs_mentioned_p, record_label_references, record_reg_life_pat, swap_rtx_condition, goto_block_pat, print_blocks): Likewise. * regclass.c (fix_register, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (stable_but_for_p): Likewise. * reload.c (loc_mentioned_in_p, operands_match_p, find_reloads_toplevsubst_reg_equivs, find_reloads_address_1, copy_replacements, refers_to_regno_for_reload_p, refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p, reload_when_needed_name, reg_class_names, debug_reload_to_stream): Likewise. * reload1.c (eliminate_regs, scan_paradoxical_subregs, delete_address_reloads_1, count_occurrences, reload_cse_mem_conflict_p, reload_combine_note_use, add_auto_inc_notes): Likewise. * resource.c (mark_referenced_resources, mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p, reg_mentioned_p, regs_set_between_p, modified_between_p, modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p, rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p, may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs, jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise. * sched.c (sched_analyze_2, attach_deaths): Likewise. * stupid.c (stupid_mark_refs): Likewise. * unroll.c (remap_split_bivs): Likewise. * varasm.c (mark_constants): Likewise. * a29k/a29k.c (uses_local_reg_p): Likewise. * alpha/alpha.c (summarize_insn): Likewise. * arm/arm.c (symbol_mentioned_p, label_mentioned_p, eliminate_lr2ip): Likewise. * arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise. * i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx, reg_mentioned_in_mem): Likewise. * ns32k/ns32k.c (global_symbolic_reference_mentioned_p, symbolic_reference_mentioned_p): Likewise. * romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise. * sh/sh.c (regs_used, mark_use): Likewise. * vax/vax.c (vax_rtx_cost): Likewise. From-SVN: r28784
1999-08-21 01:05:25 +02:00
static const char * const what_option[2][2] = {
{ "call-saved", "call-used" },
{ "no-such-option", "fixed" }};
error ("can't use '%s' as a %s register", name,
what_option[fixed][call_used]);
}
else
{
fixed_regs[i] = fixed;
call_used_regs[i] = call_used;
#ifdef CALL_REALLY_USED_REGISTERS
if (fixed == 0)
call_really_used_regs[i] = call_used;
#endif
}
}
else
1991-11-06 00:39:50 +01:00
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "unknown register name: %s", name);
1991-11-06 00:39:50 +01:00
}
}
/* Mark register number I as global. */
void
globalize_reg (int i)
{
if (fixed_regs[i] == 0 && no_global_reg_vars)
error ("global register variable follows a function definition");
if (global_regs[i])
{
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "register used for two global register variables");
return;
}
if (call_used_regs[i] && ! fixed_regs[i])
diagnostic.c (warning): Accept parameter to classify warning option. * diagnostic.c (warning): Accept parameter to classify warning option. (warning0): New, for when a pointer to an error() like function is needed. * errors.c (warning): Likewise. * errors.h (warning, warning0): Adjust prototypes. * toplev.h (warning, warning0): Likewise. * attribs.c, builtins.c, c-common.c, c-decl.c, c-format.c, c-gimplify.c, c-lex.c, c-objc-common.c, c-opts.c, c-parser.c, c-pragma.c, c-typeck.c, calls.c, cgraph.c, coverage.c, emit-rtl.c, fold-const.c, fortran/trans-decl.c, function.c, gcse.c, genautomata.c, haifa-sched.c, opts.c, passes.c, regclass.c, reload1.c, stmt.c, stor-layout.c, toplev.c, tree-cfg.c, tree-dump.c, tree-inline.c, tree-mudflap.c, tree-optimize.c, tree-ssa.c, tree.c, varasm.c: Adjust warning() callers. * config/alpha/alpha.c, config/arc/arc.c, config/arm/arm.c, config/avr/avr.c, config/bfin/bfin.c, config/c4x/c4x-c.c, config/c4x/c4x.c, config/cris/cris.c, config/darwin-c.c, config/darwin.c, config/darwin.h, config/h8300/h8300.c, config/i386/cygming.h, config/i386/djgpp.h, config/i386/i386.c, config/i386/winnt.c, config/ia64/ia64-c.c, config/ia64/ia64.c, config/ip2k/ip2k.c, config/m32r/m32r.c, config/m68hc11/m68hc11.c, config/m68k/m68k.c, config/mcore/mcore.c, config/mips/mips.c, config/mmix/mmix.c, config/ns32k/ns32k.c, config/pa/pa-hpux11.h, config/pa/pa.c, config/rs6000/aix43.h, config/rs6000/aix51.h, config/rs6000/aix52.h, config/rs6000/darwin.h, config/rs6000/rs6000-c.c, config/rs6000/rs6000.c, config/s390/s390.c, config/sh/sh.c, config/sh/sh.h, config/sh/symbian.c, config/sol2-c.c, config/sol2.c, config/stormy16/stormy16.c, config/v850/v850-c.c, config/v850/v850.c, config/xtensa/xtensa.c: Adjust warning() callers. * ada/misc.c: Adjust warning() callers. * cp/call.c, cp/class.c, cp/cvt.c, cp/decl.c, cp/decl2.c, cp/except.c, cp/friend.c, cp/init.c, cp/lex.c, cp/mangle.c, cp/method.c, cp/name-lookup.c, cp/parser.c, cp/repo.c, cp/rtti.c, cp/tree.c, cp/typeck.c, cp/typeck2.c: Adjust warning() callers. * fortran/trans-decl.c: Adjust warning() callers. * java/class.c, java/decl.c, java/expr.c, java/jcf-io.c, java/jcf-parse.c, java/jv-scan.c, java/parse.y: Adjust warning() callers. * objc/objc-act.c: Adjust warning() callers. * treelang/parse.y: Adjust warning() callers. From-SVN: r98633
2005-04-23 23:29:07 +02:00
warning (0, "call-clobbered register used for global register variable");
global_regs[i] = 1;
/* If we're globalizing the frame pointer, we need to set the
appropriate regs_invalidated_by_call bit, even if it's already
set in fixed_regs. */
if (i != STACK_POINTER_REGNUM)
{
SET_HARD_REG_BIT (regs_invalidated_by_call, i);
SET_REGNO_REG_SET (regs_invalidated_by_call_regset, i);
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
}
/* If already fixed, nothing else to do. */
if (fixed_regs[i])
return;
fixed_regs[i] = call_used_regs[i] = 1;
#ifdef CALL_REALLY_USED_REGISTERS
call_really_used_regs[i] = 1;
#endif
SET_HARD_REG_BIT (fixed_reg_set, i);
SET_HARD_REG_BIT (call_used_reg_set, i);
SET_HARD_REG_BIT (call_fixed_reg_set, i);
reinit_regs ();
}
1991-11-06 00:39:50 +01:00
/* Structure used to record preferences of given pseudo. */
struct reg_pref
{
/* (enum reg_class) prefclass is the preferred class. May be
NO_REGS if no class is better than memory. */
char prefclass;
/* altclass is a register class that we should use for allocating
pseudo if no register in the preferred class is available.
If no register in this class is available, memory is preferred.
It might appear to be more general to have a bitmask of classes here,
but since it is recommended that there be a class corresponding to the
union of most major pair of classes, that generality is not required. */
char altclass;
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
/* coverclass is a register class that IRA uses for allocating
the pseudo. */
char coverclass;
};
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
/* Record preferences of each pseudo. This is available after RA is
run. */
static struct reg_pref *reg_pref;
1991-11-06 00:39:50 +01:00
/* Return the reg_class in which pseudo reg number REGNO is best allocated.
This function is sometimes called before the info has been computed.
When that happens, just return GENERAL_REGS, which is innocuous. */
enum reg_class
reg_preferred_class (int regno)
1991-11-06 00:39:50 +01:00
{
if (reg_pref == 0)
1991-11-06 00:39:50 +01:00
return GENERAL_REGS;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
return (enum reg_class) reg_pref[regno].prefclass;
1991-11-06 00:39:50 +01:00
}
enum reg_class
reg_alternate_class (int regno)
1991-11-06 00:39:50 +01:00
{
if (reg_pref == 0)
return ALL_REGS;
return (enum reg_class) reg_pref[regno].altclass;
1991-11-06 00:39:50 +01:00
}
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
/* Return the reg_class which is used by IRA for its allocation. */
enum reg_class
reg_cover_class (int regno)
1991-11-06 00:39:50 +01:00
{
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
if (reg_pref == 0)
return NO_REGS;
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
return (enum reg_class) reg_pref[regno].coverclass;
1991-11-06 00:39:50 +01:00
}
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
/* Current size of reg_info. */
static int reg_info_size;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
/* Allocate space for reg info. */
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
static void
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
allocate_reg_info (void)
{
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
reg_info_size = max_reg_num ();
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
gcc_assert (! reg_pref && ! reg_renumber);
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
reg_renumber = XNEWVEC (short, reg_info_size);
reg_pref = XCNEWVEC (struct reg_pref, reg_info_size);
memset (reg_renumber, -1, reg_info_size * sizeof (short));
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
}
/* Resize reg info. The new elements will be uninitialized. */
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
bool
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
resize_reg_info (void)
{
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
int old;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
gcc_assert (reg_pref != NULL);
if (reg_info_size == max_reg_num ())
return false;
old = reg_info_size;
reg_info_size = max_reg_num ();
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
gcc_assert (reg_pref && reg_renumber);
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
reg_renumber = XRESIZEVEC (short, reg_renumber, reg_info_size);
reg_pref = XRESIZEVEC (struct reg_pref, reg_pref, reg_info_size);
memset (reg_pref + old, -1,
(reg_info_size - old) * sizeof (struct reg_pref));
memset (reg_renumber + old, -1, (reg_info_size - old) * sizeof (short));
return true;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
}
/* Free up the space allocated by allocate_reg_info. */
void
free_reg_info (void)
{
if (reg_pref)
{
free (reg_pref);
reg_pref = NULL;
}
if (reg_renumber)
{
free (reg_renumber);
reg_renumber = NULL;
}
}
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
/* Initialize some global data for this pass. */
static unsigned int
reginfo_init (void)
{
if (df)
df_compute_regs_ever_live (true);
/* This prevents dump_flow_info from losing if called
before reginfo is run. */
reg_pref = NULL;
allocate_reg_info ();
/* No more global register variables may be declared. */
no_global_reg_vars = 1;
return 1;
}
struct rtl_opt_pass pass_reginfo_init =
{
{
RTL_PASS,
"reginfo", /* name */
NULL, /* gate */
reginfo_init, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
TV_NONE, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
0 /* todo_flags_finish */
}
};
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
/* Set up preferred, alternate, and cover classes for REGNO as
PREFCLASS, ALTCLASS, and COVERCLASS. */
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
void
setup_reg_classes (int regno,
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
enum reg_class prefclass, enum reg_class altclass,
enum reg_class coverclass)
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
{
if (reg_pref == NULL)
return;
reg_pref[regno].prefclass = prefclass;
reg_pref[regno].altclass = altclass;
invoke.texi (-fsched-pressure): Document it. 2009-09-02 Vladimir Makarov <vmakarov@redhat.com> * doc/invoke.texi (-fsched-pressure): Document it. (-fsched-reg-pressure-heuristic): Remove it. * reload.c (ira.h): Include. (find_reloads): Add choosing reload on number of small spilled classes. * haifa-sched.c (ira.h): Include. (sched_pressure_p, sched_regno_cover_class, curr_reg_pressure, saved_reg_pressure, curr_reg_live, saved_reg_live, region_ref_regs): New variables. (sched_init_region_reg_pressure_info, mark_regno_birth_or_death, initiate_reg_pressure_info, setup_ref_regs, initiate_bb_reg_pressure_info, save_reg_pressure, restore_reg_pressure, dying_use_p, print_curr_reg_pressure): New functions. (setup_insn_reg_pressure_info): New function. (rank_for_schedule): Add pressure checking and insn issue time. Remove comparison of insn reg weights. (ready_sort): Set insn reg pressure info. (update_register_pressure, setup_insn_max_reg_pressure, update_reg_and_insn_max_reg_pressure, sched_setup_bb_reg_pressure_info): New functions. (schedule_insn): Add code for printing and updating reg pressure info. (find_set_reg_weight, find_insn_reg_weight): Remove. (ok_for_early_queue_removal): Do nothing if pressure_only_p. (debug_ready_list): Print reg pressure info. (schedule_block): Ditto. Check insn issue time. (sched_init): Set up sched_pressure_p. Allocate and set up some reg pressure related info. (sched_finish): Free some reg pressure related info. (fix_tick_ready): Make insn always ready if pressure_p. (init_h_i_d): Don't call find_insn_reg_weight. (haifa_finish_h_i_d): Free insn reg pressure info. * ira-int.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move to ira.h. * ira-lives.c (single_reg_class): Check mode to find how many registers are necessary for operand. (ira_implicitly_set_insn_hard_regs): New. * common.opt (fsched-pressure): New options. (fsched-reg-pressure-heuristic): Remove. * ira.c (setup_eliminable_regset): Rename to ira_setup_eliminable_regset. Make it external. (expand_reg_info): Pass cover class to setup_reg_classes. (ira): Call resize_reg_info instead of allocate_reg_info. * sched-deps.c: Include ira.h. (implicit_reg_pending_clobbers, implicit_reg_pending_uses): New. (create_insn_reg_use, create_insn_reg_set, setup_insn_reg_uses, reg_pressure_info, insn_use_p, mark_insn_pseudo_birth, mark_insn_hard_regno_birth, mark_insn_reg_birth, mark_pseudo_death, mark_hard_regno_death, mark_reg_death, mark_insn_reg_store, mark_insn_reg_clobber, setup_insn_reg_pressure_info): New. (sched_analyze_1): Update implicit_reg_pending_uses. (sched_analyze_insn): Find implicit sets, uses, clobbers of regs. Use them to create dependencies. Set insn reg uses and pressure info. Process reg_pending_uses in one place. (free_deps): Free implicit sets. (remove_from_deps): Remove implicit sets if necessary. Check implicit sets when clearing reg_last_in_use. (init_deps_global): Clear implicit_reg_pending_clobbers and implicit_reg_pending_uses. * ira.h (ira_hard_regno_cover_class, ira_reg_class_nregs, ira_memory_move_cost, ira_class_hard_regs, ira_class_hard_regs_num, ira_no_alloc_regs, ira_available_class_regs, ira_reg_class_cover_size, ira_reg_class_cover, ira_class_translate): Move from ira-int.h. (ira_setup_eliminable_regset, ira_set_pseudo_classes, ira_implicitly_set_insn_hard_regs): New prototypes. * ira-costs.c (pseudo_classes_defined_p, allocno_p, cost_elements_num): New variables. (allocno_costs, total_costs): Rename to costs and total_allocno_costs. (COSTS_OF_ALLOCNO): Rename to COSTS. (allocno_pref): Rename to pref. (allocno_pref_buffer): Rename to pref_buffer. (common_classes): Rename to regno_cover_class. (COST_INDEX): New. (record_reg_classes): Set allocno attributes only if allocno_p. (record_address_regs): Ditto. Use COST_INDEX instead of ALLOCNO_NUM. (scan_one_insn): Use COST_INDEX and COSTS instead of ALLOCNO_NUM and COSTS_OF_ALLOCNO. (print_costs): Rename to print_allocno_costs. (print_pseudo_costs): New. (process_bb_node_for_costs): Split into 2 functions with new function process_bb_for_costs. Pass BB to process_bb_for_costs. (find_allocno_class_costs): Rename to find_costs_and_classes. Add new parameter dump_file. Use cost_elements_num instead of ira_allocnos_num. Make one iteration if preferred classes were already calculated for scheduler. Make 2 versions of code depending on allocno_p. (setup_allocno_cover_class_and_costs): Check allocno_p. Use regno_cover_class and COSTS instead of common_classes and COSTS_OF_ALLOCNO. (init_costs, finish_costs): New. (ira_costs): Set up allocno_p and cost_elements_num. Call init_costs and finish_costs. (ira_set_pseudo_classes): New. * rtl.h (allocate_reg_info): Remove. (resize_reg_info): Change return type. (reg_cover_class): New. (setup_reg_classes): Add new parameter. * sched-int.h (struct deps_reg): New member implicit_sets. (sched_pressure_p, sched_regno_cover_class): New external definitions. (INCREASE_BITS): New macro. (struct reg_pressure_data, struct reg_use_data): New. (struct _haifa_insn_data): Remove reg_weight. Add members reg_pressure, reg_use_list, reg_set_list, and reg_pressure_excess_cost_change. (struct deps): New member implicit_sets. (pressure_p): New variable. (COVER_CLASS_BITS, INCREASE_BITS): New macros. (struct reg_pressure_data, struct reg_use_data): New. (INSN_REG_WEIGHT): Remove. (INSN_REG_PRESSURE, INSN_MAX_REG_PRESSURE, INSN_REG_USE_LIST, INSN_REG_SET_LIST, INSN_REG_PRESSURE_EXCESS_COST_CHANGE): New macros. (sched_init_region_reg_pressure_info, sched_setup_bb_reg_pressure_info): New prototypes. * reginfo.c (struct reg_pref): New member coverclass. (reg_cover_class): New function. (reginfo_init, pass_reginfo_init): Move after free_reg_info. (reg_info_size): New variable. (allocate_reg_info): Make static. Setup reg_info_size. (resize_reg_info): Use reg_info_size. Return flag of resizing. (setup_reg_classes): Add a new parameter. Setup cover class too. * Makefile.in (reload.o, haifa-sched.o, sched-deps.o): Add ira.h to the dependencies. * sched-rgn.c (deps_join): Set up implicit_sets. (schedule_region): Set up region and basic blocks pressure relative info. * passes.c (init_optimization_passes): Move pass_subregs_of_mode_init before pass_sched. From-SVN: r151348
2009-09-02 20:54:25 +02:00
reg_pref[regno].coverclass = coverclass;
[multiple changes] 2008-08-26 Vladimir Makarov <vmakarov@redhat.com> * ira-build.c, ira-color.c, ira-costs.c, ira.h, ira-lives.c, ira.c, ira-conflicts.c, ira-emit.c, ira-int.h: New files. * doc/passes.texi: Describe IRA. * doc/tm.texi (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Describe the new macros. * doc/invoke.texi (ira-max-loops-num): Describe the new parameter. (-fira, -fira-algorithm, -fira-coalesce, -fno-ira-move-spills, -fira-propagate-cost, -fno-ira-share-save-slots, -fno-ira-share-spill-slots, -fira-verbose): Describe new options. * flags.h (ira_algorithm): New enumeration. (flag_ira_algorithm, flag_ira_verbose): New external variable declarations. * postreload.c (gate_handle_postreload): Don't do post reload optimizations unless the reload is completed. * reload.c (push_reload, find_dummy_reload): Use DF_LR_OUT for IRA. * tree-pass.h (pass_ira): New external variable declaration. * reload.h: Add 2008 to the Copyright. * cfgloopanal.c: Include params.h. (estimate_reg_pressure_cost): Decrease cost for IRA optimization mode. * params.h (IRA_MAX_LOOPS_NUM): New macro. * toplev.c (ira.h): New include. (flag_ira_algorithm, flag_ira_verbose): New external variables. (backend_init_target): Call ira_init. (backend_init): Call ira_init_once. (finalize): Call finish_ira_once. * toplev.h (flag_ira, flag_ira_coalesce, flag_ira_move_spills, flag_ira_share_save_slots, flag_ira_share_spill_slots): New external variables. * regs.h (contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): New external variable declarations. (move_table): New typedef. * caller-save.c: Include headers output.h and ira.h. (no_caller_save_reg_set): New global variable. (save_slots_num, save_slots): New variables. (reg_save_code, reg_restore_code, add_stored_regs): Add prototypes. (init_caller_save): Set up no_caller_save_reg_set. (init_save_areas): Reset save_slots_num. (saved_hard_reg): New structure. (hard_reg_map, saved_regs_num, all_saved_regs): New variables. (initiate_saved_hard_regs, new_saved_hard_reg, finish_saved_hard_regs, saved_hard_reg_compare_func): New functions. (setup_save_areas): Add code for sharing stack slots. (all_blocks): New variable. (save_call_clobbered_regs): Process pseudo-register too. (mark_set_regs): Process pseudo-register too. (insert_one_insn): Put the insn after bb note in a empty basic block. Add insn check. * global.c (eliminable_regset): Make it external. (mark_elimination): Use DF_LR_IN for IRA. (pseudo_for_reload_consideration_p): New. (build_insn_chain): Make it external. Don't ignore spilled pseudos for IRA. Use pseudo_for_reload_consideration_p. (gate_handle_global_alloc): New function. (pass_global_alloc): Add the gate function. * opts.c (decode_options): Set up flag_ira. Print the warning for -fira. (common_handle_option): Process -fira-algorithm and -fira-verbose. * timevar.def (TV_IRA, TV_RELOAD): New passes. * regmove.c (regmove_optimize): Don't do replacement of output for IRA. * hard-reg-set.h (no_caller_save_reg_set, reg_class_subclasses): New external variable declarations. * local-alloc.c (update_equiv_regs): Make it external. Return true if jump label rebuilding should be done. Rescan new_insn for notes. (gate_handle_local_alloc): New function. (pass_local_alloc): Add the gate function. * alias.c (value_addr_p, stack_addr_p): New functions. (nonoverlapping_memrefs_p): Use them for IRA. * common.opt (fira, fira-algorithm, fira-coalesce, fira-move-spills, fira-share-save-slots, fira-share-spill-slots, fira-verbose): New options. * regclass.c (reg_class_subclasses, contains_reg_of_mode, move_cost, may_move_in_cost, may_move_out_cost): Make the variables external. (move_table): Remove typedef. (init_move_cost): Make it external. (allocate_reg_info, resize_reg_info, setup_reg_classes): New functions. * rtl.h (init_move_cost, allocate_reg_info, resize_reg_info, setup_reg_classes): New function prototypes. (eliminable_regset): New external variable declaration. (build_insn_chain, update_equiv_regs): New function prototypes. * Makefile.in (IRA_INT_H): New definition. (OBJS-common): Add ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, and ira-lives.o. (reload1.o, toplev.o): Add dependence on ira.h. (cfgloopanal.o): Add PARAMS_H. (caller-save.o): Add dependence on output.h and ira.h. (ira.o, ira-build.o, ira-costs.o, ira-conflicts.o, ira-color.o, ira-emit.o, ira-lives.o): New entries. * passes.c (pass_ira): New pass. * params.def (PARAM_IRA_MAX_LOOPS_NUM): New parameter. * reload1.c (ira.h): Include the header. (changed_allocation_pseudos): New bitmap. (init_reload): Initiate the bitmap. (compute_use_by_pseudos): Permits spilled registers in FROM. (temp_pseudo_reg_arr): New variable. (reload): Allocate and free temp_pseudo_reg_arr. Sort pseudos for IRA. Call alter_reg with the additional parameter. Don't clear spilled_pseudos for IRA. Restore original insn chain for IRA. Clear changed_allocation_pseudos at the end of reload. (calculate_needs_all_insns): Call IRA's mark_memory_move_deletion. (hard_regno_to_pseudo_regno): New variable. (count_pseudo): Check spilled pseudos. Set up hard_regno_to_pseudo_regno. (count_spilled_pseudo): Check spilled pseudos. Update hard_regno_to_pseudo_regno. (find_reg): Use better_spill_reload_regno_p. Check hard_regno_to_pseudo_regno. (alter_reg): Set up spilled_pseudos. Add a new parameter. Add code for IRA. (eliminate_regs_1): Use additional parameter for alter_reg. (finish_spills): Set up pseudo_previous_regs only for spilled pseudos. Call reassign_pseudos once for all spilled pseudos, pass more arguments. Don't clear live_throughout and dead_or_set for spilled pseudos. Use additional parameter for alter_reg. Call mark_allocation_change. Set up changed_allocation_pseudos. Remove sanity check. (emit_input_reload_insns, delete_output_reload): Use additional parameter for alter_reg. Call mark_allocation_change. (substitute, gen_reload_chain_without_interm_reg_p): New functions. (reloads_conflict): Use gen_reload_chain_without_interm_reg_p. * testsuite/gcc.dg/20080410-1.c: New file. * config/s390/s390.h (IRA_COVER_CLASSES, IRA_HARD_REGNO_ADD_COST_MULTIPLIER): Define. * config/sparc/sparc.h (IRA_COVER_CLASSES): New macro. * config/i386/i386.h (IRA_COVER_CLASSES): Ditto. * config/ia64/ia64.h (IRA_COVER_CLASSES): Ditto. * config/rs6000/rs6000.h (IRA_COVER_CLASSES): Ditto. * config/arm/arm.h (IRA_COVER_CLASSES): Ditto. * config/alpha/alpha.h (IRA_COVER_CLASSES): Ditto. 2008-08-24 Jeff Law <law@redhat.com> * ira.c (setup_reg_class_intersect_union): Prefer smallest class when ignoring unavailable registers. 2008-08-24 Jeff Law <law@redhat.com> * ira-color.c (coalesced_pseudo_reg_slot_compare): Check FRAME_GROWS_DOWNWARD and STACK_GROWS_DOWNWARD. * ira.c (setup_eliminable_regset): Check stack_realign_needed. * config/mn10300/mn10300.h (IRA_COVER_CLASSES): New macro. 2008-06-03 Steve Chamberlain <steve.chamberlain@gmail.com> * ira-build.c (allocno_range_compare_func): Stabilize sort. 2008-05-29 Andy Hutchinson <hutchinsonandy@aim.com> * config/avr/avr.h (IRA_COVER_CLASSES): New macro. * reload1.c (find_reg): Process registers in register allocation order. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * toplev.c (backend_init_target): Move ira_init call from here... (lang_dependent_init_target): ...to here. 2008-05-10 Richard Sandiford <rsandifo@nildram.co.uk> * ira.c (setup_class_subset_and_memory_move_costs): Don't calculate memory move costs for NO_REGS. 2008-05-05 Kaz Kojima <kkojima@gcc.gnu.org> * ira-color.c (ira_fast_allocation): Use no_stack_reg_p only if STACK_REGS is defined. 2008-04-08 Andrew Pinski <andrew_pinski@playstation.sony.com> * config/spu/spu.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Bernd Schmidt <bernd.schmidt@analog.com> * config/bfin/bfin.h (IRA_COVER_CLASSES): New macro. 2008-04-04 Kaz Kojima <kkojima@gcc.gnu.org> * config/sh/sh.h (IRA_COVER_CLASSES): Define. * config/sh/sh.md (movsicc_true+3): Check if emit returns a barrier. From-SVN: r139590
2008-08-26 14:39:58 +02:00
}
1991-11-06 00:39:50 +01:00
/* This is the `regscan' pass of the compiler, run just before cse and
again just before loop. It finds the first and last use of each
pseudo-register. */
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
static void reg_scan_mark_refs (rtx, rtx);
1991-11-06 00:39:50 +01:00
void
reg_scan (rtx f, unsigned int nregs ATTRIBUTE_UNUSED)
1991-11-06 00:39:50 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx insn;
1991-11-06 00:39:50 +01:00
timevar_push (TV_REG_SCAN);
1991-11-06 00:39:50 +01:00
for (insn = f; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
1991-11-06 00:39:50 +01:00
{
reg_scan_mark_refs (PATTERN (insn), insn);
if (REG_NOTES (insn))
reg_scan_mark_refs (REG_NOTES (insn), insn);
}
timevar_pop (TV_REG_SCAN);
}
/* X is the expression to scan. INSN is the insn it appears in.
NOTE_FLAG is nonzero if X is from INSN's notes rather than its body.
We should only record information for REGs with numbers
greater than or equal to MIN_REGNO. */
static void
reg_scan_mark_refs (rtx x, rtx insn)
1991-11-06 00:39:50 +01:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
enum rtx_code code;
rtx dest;
rtx note;
1991-11-06 00:39:50 +01:00
[multiple changes] 2002-07-15 Michael Matz <matz@suse.de>, Daniel Berlin <dberlin@dberlin.org>, Denis Chertykov <denisc@overta.ru> Add a new register allocator. * ra.c: New file. * ra.h: New file. * ra-build.c: New file. * ra-colorize.c: New file. * ra-debug.c: New file. * ra-rewrite.c: New file. * Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o, (ra-rewrite.o): New .o files for libbackend.a. (GTFILES): Add basic-block.h. * toplev.c (flag_new_regalloc): New. (f_options): New option "new-ra". (rest_of_compilation): Call initialize_uninitialized_subregs() only for the old allocator. If flag_new_regalloc is set, call new allocator, instead of local_alloc(), global_alloc() and friends. * doc/invoke.texi: Document -fnew-ra. * basic-block.h (FOR_ALL_BB): New. * config/rs6000/rs6000.c (print_operand): Write small constants as @l+80. * df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg. (df_reg_table_realloc): Make size at least as large as max_reg_num(). (df_insn_table_realloc): Size argument now is absolute, not relative. Changed all callers. * gengtype.c (main): Add the pseudo-type "HARD_REG_SET". * regclass.c (reg_scan_mark_refs): Ignore NULL rtx's. 2002-06-20 Michael Matz <matz@suse.de> * df.h (struct ref.id): Make unsigned. * df.c (df_bb_reg_def_chain_create): Remove unsigned cast. 2002-06-13 Michael Matz <matz@suse.de> * df.h (DF_REF_MODE_CHANGE): New flag. * df.c (df_def_record_1, df_uses_record): Set this flag for refs involving subregs with invalid mode changes, when CLASS_CANNOT_CHANGE_MODE is defined. 2002-05-07 Michael Matz <matz@suse.de> * reload1.c (fixup_abnormal_edges): Don't insert on NULL edge. 2002-05-03 Michael Matz <matz@suse.de> * sbitmap.c (sbitmap_difference): Accept sbitmaps of different size. Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru> * regclass.c (regclass): Work with all regs which have sets or refs. (reg_scan_mark_refs): Count regs inside (clobber ...). 2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de> * df.c (df_ref_record): Correctly calculate SUBREGs of hardregs. (df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only add new refs. (df_bb_refs_update): Don't clear insns_modified here, ... (df_analyse): ... but here. * sbitmap.c (dump_sbitmap_file): New. (debug_sbitmap): Use it. * sbitmap.h (dump_sbitmap_file): Add prototype. 2001-08-07 Daniel Berlin <dan@cgsoftware.com> * df.c (df_insn_modify): Grow the UID table if necessary, rather than assume all emits go through df_insns_modify. 2001-07-26 Daniel Berlin <dan@cgsoftware.com> * regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS, increase REG_N_REFS (like flow does), so that regclass doesn't think a reg is useless, and thus, not calculate a class, when it really should have. 2001-01-28 Daniel Berlin <dberlin@redhat.com> * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for dataflow analysis. From-SVN: r55458
2002-07-15 16:07:06 +02:00
if (!x)
return;
code = GET_CODE (x);
1991-11-06 00:39:50 +01:00
switch (code)
{
case CONST:
case CONST_INT:
1991-11-06 00:39:50 +01:00
case CONST_DOUBLE:
rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. * rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. (copy_rtx): Handle CONST_FIXED. (rtx_equal_p): Likewise. * rtl.h (fixed_value.h): New include. (rtx_def): Add a new field of fixed_value to u. (XCNMPFV): Define for accessing fixed_value. (CONST_FIXED_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW): Define. * rtl.def (CONST_FIXED): New constant. (SS_MULT, US_MULT, SS_DIV, US_DIV, FRACT_CONVERT, UNSIGNED_FRACT_CONVERT, SAT_FRACT, UNSIGNED_SAT_FRACT, US_NEG, US_ASHIFT): New codes. * doc/rtl.texi (Expressions): Document const_fixed, us_neg, ss_mult, us_mult, ss_div, us_div, us_ashift, fract_convert, sat_fract, unsigned_fract_convert, unsigned_sat_fract): Document them. * varasm.c (assemble_integer): Extend to support fixed-point constants by using different machine classes. (decode_addr_const): Handle FIXED_CST. (const_hash_1): Likewise. (compare_constant): Likewise. (copy_constant): Likewise. (const_rtx_hash_1): Handle CONST_FIXED. (output_constant_pool_2): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (initializer_constant_valid_p): Handle FIXED_CST. (output_constant): Support FIXED_POINT_TYPE. * gengenrtl.c (excluded_rtx): Check CONST_FIXED to exclude. * cse.c (hash_rtx): Support CONST_FIXED. (exp_equiv_p): Likewise. (cannon_reg): Likewise. (fold_rtx): Likewise. (equiv_constant): Likewise. (cse_process_notes_1): Likewise. (count_reg_usage): Likewise. * cselib.c (entry_and_rtx_equal_p): Check CONST_FIXED. (rtx_equal_for_cselib_p): Handle CONST_FIXED. (wrap_constant): Check CONST_FIXED. (cselib_hash_rtx): Support CONST_FIXED. (cselib_subst_to_values): Likewise. * df-scan.c (df_uses_record): Likewise. * gcse.c (want_to_gcse_p): Likewise. (oprs_unchanged_p): Likewise. (oprs_not_set_p): Likewise. (compute_transp): Likewise. (extract_mentioned_regs_helper): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. (contains_replace_regs): Likewise. (memref_referenced_p): Likewise. * loop-invariant.c (check_maybe_invariant): Likewise. (hash_invariant_expr_1): Likewise. (invariant_expr_equal_p): Likewise. * postreload-gcse.c (oprs_unchanged_p): Likewise. * regclass.c (reg_scan_mark_refs): Likewise. * regrename.c (scan_rtx): Likewise. * resource.c (mark_referenced_resources): Likewise. (mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p): Likewise. (rtx_varies_p): Likewise. (count_occurrences): Likewise. (reg_mentioned_p): Likewise. (modified_between_p): Likewise. (modified_in_p): Likewise. (volatile_insn_p): Likewise. (volatile_refs_p): Likewise. (side_effects_p): Likewise. (may_trap_p_1): Likewise. (inequality_comparisons_p): Likewise. (computed_jump_p_1): Likewise. (commutative_operand_precedence): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * sched-vis.c (print_value): Likewise. * reload.c (operands_match_p): Likewise. (subst_reg_equivs): Likewise. * reload1.c (eliminate_regs_1): Likewise. (elimination_effects): Likewise. (scan_paradoxical_subregs): Likewise. * alias.c (rtx_equal_for_memref_p): Likewise. * Makefile.in (RTL_BASE_H): Add fixed-value.h. * emit-rtl.c (const_fixed_htab): New hash table. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed): Declare. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed, const_fixed_from_fixed_value): New functions. (verify_rtx_sharing): Handle CONST_FIXED. (copy_rtx_if_shared_1): Likewise. (reset_used_flags): Likewise. (set_used_flags): Likewise. (copy_insn_1): Likewise. (init_emit_once): Create const_fixed_htab. Store fixed-point scalar and vector zero and one to const_tiny_rtx. From-SVN: r127725
2007-08-23 02:30:39 +02:00
case CONST_FIXED:
i386.md ("mmx_uavgv8qi3"): Use const_vector. 2002-02-19 Aldy Hernandez <aldyh@redhat.com> * config/i386/i386.md ("mmx_uavgv8qi3"): Use const_vector. ("mmx_uavgv4hi3"): Same. ("pmulhrwv4hi3"): Same. * tree-inline.c (walk_tree): Handle vectors. * c-common.c (constant_expression_warning): Handle vectors. (overflow_warning): Same. * sched-deps.c (sched_analyze_2): Handle vectors. * rtlanal.c (rtx_unstable_p): Handle vectors. (rtx_varies_p): Same. (count_occurrences): Same. (regs_set_between_p): Same. (modified_between_p): Same. (modified_in_p): Same. (volatile_insn_p): Same. (volatile_refs_p): Same. (side_effects_p): Same. (may_trap_p): Same. (inequality_comparisons_p): Same. (replace_regs): Same. (computed_jump_p_1): Same. * rtl.c (DEF_MACHMODE): Change all definitions to accept 8th argument. (inner_mode_array): New. (copy_rtx): Handle vectors. (copy_most_rtx): Same. (rtx_equal_p): Same. (get_mode_alignment): Adjust for vectors. * resource.c (mark_referenced_resources): Handle vectors. (mark_set_resources): Same. * reload1.c (eliminate_regs): Handle vectors. (elimination_effects): Same. (scan_paradoxical_subregs): Same. * reload.c (subst_reg_equivs): Handle vectors. * regrename.c (scan_rtx): Handle vectors. * regclass.c (reg_scan_mark_refs): Handle vectors. * recog.c (find_single_use_1): Handle vectors. * local-alloc.c (equiv_init_varies_p): Handle vectors. (contains_replace_regs): Same. (memref_referenced_p): Same. * integrate.c (copy_rtx_and_substitute): Handle vectors. (subst_constants): Same. * genattrtab.c (attr_copy_rtx): Handle vectors. (encode_units_mask): Same. (clear_struct_flag): Same. (count_sub_rtxs): Same. * gcse.c (want_to_gcse_p): Handle vectors. (oprs_unchanged_p): Same. (hash_expr_1): Same. (oprs_not_set_p): Same. (expr_killed_p): Same. (compute_transp): Same. (store_ops_ok): Same. * function.c (purge_addressof_1): Do not allow paradoxical subregs of vectors. (fixup_var_refs_1): Same. (instantiate_virtual_regs_1): Same. * fold-const.c (operand_equal_p): Handle vectors. (fold): Same. (rtl_expr_nonnegative_p): Same. * flow.c (mark_used_regs): Handle vectors. * df.c (df_uses_record): Handle vectors. * cselib.c (cselib_subst_to_values): Handle vectors. (cselib_mem_conflict_p): Same. (hash_rtx): Same. * cse.c (canon_reg): Handle vectors. (fold_rt): Same. (cse_process_notes): Same. (count_reg_usage): Same. (canon_hash): Same. * alias.c (nonlocal_mentioned_p): Add case for CONST_VECTOR. * combine.c (mark_used_regs_combine): Add case for CONST_VECTOR. * emit-rtl.c (init_emit_once): Generate const0_rtx for vectors. (gen_rtx): Handle CONST_VECTOR. (gen_const_vector_0): New. (copy_rtx_if_shared): CONST_VECTORs can be shared. (reset_used_flags): Same. (copy_insn_1): Same. (initializer_constant_valid_p): Handle VECTOR_CST. * doc/c-tree.texi (Expression trees): Document VECTOR_CST. * doc/rtl.texi (Constants): Document const_vector. (CONST0_RTX): Update for vectors. (RTL sharing): Same. * print-tree.c (print_node): Add case for VECTOR_CST. * tree.h (TREE_VECTOR_CST_ELTS): New. (struct tree_vector): New. (union tree_node): Add vector node. (build_vector): Add prototype. * tree.def (VECTOR_CST): New. * tree.c (build_vector): New. * expmed.c (make_tree): Handle CONST_VECTOR. * rtl.h (CONSTANT_P): CONST_VECTORs are constants too. (CONST_VECTOR_ELT): New. (CONST_VECTOR_NUNITS): New. * machmode.h (GET_MODE_INNER): New. (DEF_MACHMODE): Accept 8th arg. * machmode.def: Add 8th argument for vector inner mode. Add inner vector modes for vectors. * rtl.def (VEC_CONST): Remove. (CONST_VECTOR): New. * expr.c (clear_storage): Allow vectors. (is_zeros_p): Handle VECTOR_CST. * varasm.c (output_constant_pool): Handle vectors. (rtx_const): Add veclo and vechi fields. (kind): Add RTX_VECTOR. (decode_rtx_const): Add case for vector. * config/rs6000/rs6000-protos.h: Add zero_constant. * config/rs6000/rs6000.c (rs6000_emit_move): Handle vector constants. Force easy vector constants into memory. (easy_vector_constant): New. (emit_easy_vector_constant): New. (rs6000_legitimize_reload_address): Do not generate bad reloads on darwin. * config/rs6000/rs6000.md ("altivec_lvx"): Reflect what instruction does. ("altivec_lvxl"): Same. (altivec_lvebx): Same. (altivec_lvehx): Same. (altivec_lvewx): Same. ("*movv4si_const0"): New. ("*movv4sf_const0"): New. ("*movv8hi_const0"): New. ("*movv16qi_const0"): New. From-SVN: r49853
2002-02-19 03:53:41 +01:00
case CONST_VECTOR:
1991-11-06 00:39:50 +01:00
case CC0:
case PC:
case SYMBOL_REF:
case LABEL_REF:
case ADDR_VEC:
case ADDR_DIFF_VEC:
case REG:
return;
1991-11-06 00:39:50 +01:00
case EXPR_LIST:
if (XEXP (x, 0))
reg_scan_mark_refs (XEXP (x, 0), insn);
if (XEXP (x, 1))
reg_scan_mark_refs (XEXP (x, 1), insn);
break;
case INSN_LIST:
if (XEXP (x, 1))
reg_scan_mark_refs (XEXP (x, 1), insn);
break;
[multiple changes] 2002-07-15 Michael Matz <matz@suse.de>, Daniel Berlin <dberlin@dberlin.org>, Denis Chertykov <denisc@overta.ru> Add a new register allocator. * ra.c: New file. * ra.h: New file. * ra-build.c: New file. * ra-colorize.c: New file. * ra-debug.c: New file. * ra-rewrite.c: New file. * Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o, (ra-rewrite.o): New .o files for libbackend.a. (GTFILES): Add basic-block.h. * toplev.c (flag_new_regalloc): New. (f_options): New option "new-ra". (rest_of_compilation): Call initialize_uninitialized_subregs() only for the old allocator. If flag_new_regalloc is set, call new allocator, instead of local_alloc(), global_alloc() and friends. * doc/invoke.texi: Document -fnew-ra. * basic-block.h (FOR_ALL_BB): New. * config/rs6000/rs6000.c (print_operand): Write small constants as @l+80. * df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg. (df_reg_table_realloc): Make size at least as large as max_reg_num(). (df_insn_table_realloc): Size argument now is absolute, not relative. Changed all callers. * gengtype.c (main): Add the pseudo-type "HARD_REG_SET". * regclass.c (reg_scan_mark_refs): Ignore NULL rtx's. 2002-06-20 Michael Matz <matz@suse.de> * df.h (struct ref.id): Make unsigned. * df.c (df_bb_reg_def_chain_create): Remove unsigned cast. 2002-06-13 Michael Matz <matz@suse.de> * df.h (DF_REF_MODE_CHANGE): New flag. * df.c (df_def_record_1, df_uses_record): Set this flag for refs involving subregs with invalid mode changes, when CLASS_CANNOT_CHANGE_MODE is defined. 2002-05-07 Michael Matz <matz@suse.de> * reload1.c (fixup_abnormal_edges): Don't insert on NULL edge. 2002-05-03 Michael Matz <matz@suse.de> * sbitmap.c (sbitmap_difference): Accept sbitmaps of different size. Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru> * regclass.c (regclass): Work with all regs which have sets or refs. (reg_scan_mark_refs): Count regs inside (clobber ...). 2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de> * df.c (df_ref_record): Correctly calculate SUBREGs of hardregs. (df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only add new refs. (df_bb_refs_update): Don't clear insns_modified here, ... (df_analyse): ... but here. * sbitmap.c (dump_sbitmap_file): New. (debug_sbitmap): Use it. * sbitmap.h (dump_sbitmap_file): Add prototype. 2001-08-07 Daniel Berlin <dan@cgsoftware.com> * df.c (df_insn_modify): Grow the UID table if necessary, rather than assume all emits go through df_insns_modify. 2001-07-26 Daniel Berlin <dan@cgsoftware.com> * regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS, increase REG_N_REFS (like flow does), so that regclass doesn't think a reg is useless, and thus, not calculate a class, when it really should have. 2001-01-28 Daniel Berlin <dberlin@redhat.com> * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for dataflow analysis. From-SVN: r55458
2002-07-15 16:07:06 +02:00
case CLOBBER:
if (MEM_P (XEXP (x, 0)))
reg_scan_mark_refs (XEXP (XEXP (x, 0), 0), insn);
[multiple changes] 2002-07-15 Michael Matz <matz@suse.de>, Daniel Berlin <dberlin@dberlin.org>, Denis Chertykov <denisc@overta.ru> Add a new register allocator. * ra.c: New file. * ra.h: New file. * ra-build.c: New file. * ra-colorize.c: New file. * ra-debug.c: New file. * ra-rewrite.c: New file. * Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o, (ra-rewrite.o): New .o files for libbackend.a. (GTFILES): Add basic-block.h. * toplev.c (flag_new_regalloc): New. (f_options): New option "new-ra". (rest_of_compilation): Call initialize_uninitialized_subregs() only for the old allocator. If flag_new_regalloc is set, call new allocator, instead of local_alloc(), global_alloc() and friends. * doc/invoke.texi: Document -fnew-ra. * basic-block.h (FOR_ALL_BB): New. * config/rs6000/rs6000.c (print_operand): Write small constants as @l+80. * df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg. (df_reg_table_realloc): Make size at least as large as max_reg_num(). (df_insn_table_realloc): Size argument now is absolute, not relative. Changed all callers. * gengtype.c (main): Add the pseudo-type "HARD_REG_SET". * regclass.c (reg_scan_mark_refs): Ignore NULL rtx's. 2002-06-20 Michael Matz <matz@suse.de> * df.h (struct ref.id): Make unsigned. * df.c (df_bb_reg_def_chain_create): Remove unsigned cast. 2002-06-13 Michael Matz <matz@suse.de> * df.h (DF_REF_MODE_CHANGE): New flag. * df.c (df_def_record_1, df_uses_record): Set this flag for refs involving subregs with invalid mode changes, when CLASS_CANNOT_CHANGE_MODE is defined. 2002-05-07 Michael Matz <matz@suse.de> * reload1.c (fixup_abnormal_edges): Don't insert on NULL edge. 2002-05-03 Michael Matz <matz@suse.de> * sbitmap.c (sbitmap_difference): Accept sbitmaps of different size. Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru> * regclass.c (regclass): Work with all regs which have sets or refs. (reg_scan_mark_refs): Count regs inside (clobber ...). 2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de> * df.c (df_ref_record): Correctly calculate SUBREGs of hardregs. (df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only add new refs. (df_bb_refs_update): Don't clear insns_modified here, ... (df_analyse): ... but here. * sbitmap.c (dump_sbitmap_file): New. (debug_sbitmap): Use it. * sbitmap.h (dump_sbitmap_file): Add prototype. 2001-08-07 Daniel Berlin <dan@cgsoftware.com> * df.c (df_insn_modify): Grow the UID table if necessary, rather than assume all emits go through df_insns_modify. 2001-07-26 Daniel Berlin <dan@cgsoftware.com> * regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS, increase REG_N_REFS (like flow does), so that regclass doesn't think a reg is useless, and thus, not calculate a class, when it really should have. 2001-01-28 Daniel Berlin <dberlin@redhat.com> * sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for dataflow analysis. From-SVN: r55458
2002-07-15 16:07:06 +02:00
break;
1991-11-06 00:39:50 +01:00
case SET:
/* Count a set of the destination if it is a register. */
for (dest = SET_DEST (x);
GET_CODE (dest) == SUBREG || GET_CODE (dest) == STRICT_LOW_PART
|| GET_CODE (dest) == ZERO_EXTEND;
dest = XEXP (dest, 0))
;
/* If this is setting a pseudo from another pseudo or the sum of a
pseudo and a constant integer and the other pseudo is known to be
a pointer, set the destination to be a pointer as well.
Likewise if it is setting the destination from an address or from a
value equivalent to an address or to the sum of an address and
something else.
But don't do any of this if the pseudo corresponds to a user
variable since it should have already been set as a pointer based
on the type. */
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (SET_DEST (x))
&& REGNO (SET_DEST (x)) >= FIRST_PSEUDO_REGISTER
/* If the destination pseudo is set more than once, then other
sets might not be to a pointer value (consider access to a
union in two threads of control in the presence of global
function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to... * function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to regno_pointer_align_length. Delete define for REGNO_POINTER_FLAG. * integrate.h (inline_remap): Delete member regno_pointer_flag. Add member x_regno_reg_rtx. * rtl.h (rtx_def): Use frame_related bit to indicate register is a pointer in REG expressions. Define REG_POINTER macro. * alias.c (find_base_value, find_base_term): Use REG_POINTER instead of REGNO_POINTER_FLAG. * combine.c (nonzero_bits, num_sign_bit_copies): Likewise. * emit-rtl.c (gen_reg_rtx): Use regno_pointer_align_length instead of regno_pointer_flag_length. Remove code which refers to regno_pointer_flag. (mark_reg_pointer): Use REG_POINTER. (free_emit_status): Remove code which refers to regno_pointer_flag. (init_emit, mark_emit_status): Likewise. * flow.c (dump_flow_info): Likewise. * function.c (preserve_temp_slots): Likewise. * integrate.c (expand_inline_function, copy_rtx_and_substitute): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * loop.c (strength_reduce, maybe_eliminate_biv_1): Use REG_POINTER. * predict.c (estimate_probability): Likewise. * regclass.c (record_address_regs, reg_scan_mark_refs): Likewise. * unroll.c (unroll_loop): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * convex.h (RTX_COSTS): Don't test regno_pointer_flag and use REG_POINTER. * pa.c (hppa_legitimize_address, emit_move_sequence, basereg_operand): Use REG_POINTER. (restore_unscaled_index_insn_codes): Revise comment. From-SVN: r37863
2000-11-30 07:31:19 +01:00
optimizations). So only set REG_POINTER on the destination
pseudo if this is the only set of that pseudo. */
&& DF_REG_DEF_COUNT (REGNO (SET_DEST (x))) == 1
&& ! REG_USERVAR_P (SET_DEST (x))
function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to... * function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to regno_pointer_align_length. Delete define for REGNO_POINTER_FLAG. * integrate.h (inline_remap): Delete member regno_pointer_flag. Add member x_regno_reg_rtx. * rtl.h (rtx_def): Use frame_related bit to indicate register is a pointer in REG expressions. Define REG_POINTER macro. * alias.c (find_base_value, find_base_term): Use REG_POINTER instead of REGNO_POINTER_FLAG. * combine.c (nonzero_bits, num_sign_bit_copies): Likewise. * emit-rtl.c (gen_reg_rtx): Use regno_pointer_align_length instead of regno_pointer_flag_length. Remove code which refers to regno_pointer_flag. (mark_reg_pointer): Use REG_POINTER. (free_emit_status): Remove code which refers to regno_pointer_flag. (init_emit, mark_emit_status): Likewise. * flow.c (dump_flow_info): Likewise. * function.c (preserve_temp_slots): Likewise. * integrate.c (expand_inline_function, copy_rtx_and_substitute): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * loop.c (strength_reduce, maybe_eliminate_biv_1): Use REG_POINTER. * predict.c (estimate_probability): Likewise. * regclass.c (record_address_regs, reg_scan_mark_refs): Likewise. * unroll.c (unroll_loop): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * convex.h (RTX_COSTS): Don't test regno_pointer_flag and use REG_POINTER. * pa.c (hppa_legitimize_address, emit_move_sequence, basereg_operand): Use REG_POINTER. (restore_unscaled_index_insn_codes): Revise comment. From-SVN: r37863
2000-11-30 07:31:19 +01:00
&& ! REG_POINTER (SET_DEST (x))
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
&& ((REG_P (SET_SRC (x))
function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to... * function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to regno_pointer_align_length. Delete define for REGNO_POINTER_FLAG. * integrate.h (inline_remap): Delete member regno_pointer_flag. Add member x_regno_reg_rtx. * rtl.h (rtx_def): Use frame_related bit to indicate register is a pointer in REG expressions. Define REG_POINTER macro. * alias.c (find_base_value, find_base_term): Use REG_POINTER instead of REGNO_POINTER_FLAG. * combine.c (nonzero_bits, num_sign_bit_copies): Likewise. * emit-rtl.c (gen_reg_rtx): Use regno_pointer_align_length instead of regno_pointer_flag_length. Remove code which refers to regno_pointer_flag. (mark_reg_pointer): Use REG_POINTER. (free_emit_status): Remove code which refers to regno_pointer_flag. (init_emit, mark_emit_status): Likewise. * flow.c (dump_flow_info): Likewise. * function.c (preserve_temp_slots): Likewise. * integrate.c (expand_inline_function, copy_rtx_and_substitute): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * loop.c (strength_reduce, maybe_eliminate_biv_1): Use REG_POINTER. * predict.c (estimate_probability): Likewise. * regclass.c (record_address_regs, reg_scan_mark_refs): Likewise. * unroll.c (unroll_loop): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * convex.h (RTX_COSTS): Don't test regno_pointer_flag and use REG_POINTER. * pa.c (hppa_legitimize_address, emit_move_sequence, basereg_operand): Use REG_POINTER. (restore_unscaled_index_insn_codes): Revise comment. From-SVN: r37863
2000-11-30 07:31:19 +01:00
&& REG_POINTER (SET_SRC (x)))
|| ((GET_CODE (SET_SRC (x)) == PLUS
|| GET_CODE (SET_SRC (x)) == LO_SUM)
&& CONST_INT_P (XEXP (SET_SRC (x), 1))
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
&& REG_P (XEXP (SET_SRC (x), 0))
function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to... * function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to regno_pointer_align_length. Delete define for REGNO_POINTER_FLAG. * integrate.h (inline_remap): Delete member regno_pointer_flag. Add member x_regno_reg_rtx. * rtl.h (rtx_def): Use frame_related bit to indicate register is a pointer in REG expressions. Define REG_POINTER macro. * alias.c (find_base_value, find_base_term): Use REG_POINTER instead of REGNO_POINTER_FLAG. * combine.c (nonzero_bits, num_sign_bit_copies): Likewise. * emit-rtl.c (gen_reg_rtx): Use regno_pointer_align_length instead of regno_pointer_flag_length. Remove code which refers to regno_pointer_flag. (mark_reg_pointer): Use REG_POINTER. (free_emit_status): Remove code which refers to regno_pointer_flag. (init_emit, mark_emit_status): Likewise. * flow.c (dump_flow_info): Likewise. * function.c (preserve_temp_slots): Likewise. * integrate.c (expand_inline_function, copy_rtx_and_substitute): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * loop.c (strength_reduce, maybe_eliminate_biv_1): Use REG_POINTER. * predict.c (estimate_probability): Likewise. * regclass.c (record_address_regs, reg_scan_mark_refs): Likewise. * unroll.c (unroll_loop): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * convex.h (RTX_COSTS): Don't test regno_pointer_flag and use REG_POINTER. * pa.c (hppa_legitimize_address, emit_move_sequence, basereg_operand): Use REG_POINTER. (restore_unscaled_index_insn_codes): Revise comment. From-SVN: r37863
2000-11-30 07:31:19 +01:00
&& REG_POINTER (XEXP (SET_SRC (x), 0)))
|| GET_CODE (SET_SRC (x)) == CONST
|| GET_CODE (SET_SRC (x)) == SYMBOL_REF
|| GET_CODE (SET_SRC (x)) == LABEL_REF
|| (GET_CODE (SET_SRC (x)) == HIGH
&& (GET_CODE (XEXP (SET_SRC (x), 0)) == CONST
|| GET_CODE (XEXP (SET_SRC (x), 0)) == SYMBOL_REF
|| GET_CODE (XEXP (SET_SRC (x), 0)) == LABEL_REF))
|| ((GET_CODE (SET_SRC (x)) == PLUS
|| GET_CODE (SET_SRC (x)) == LO_SUM)
&& (GET_CODE (XEXP (SET_SRC (x), 1)) == CONST
|| GET_CODE (XEXP (SET_SRC (x), 1)) == SYMBOL_REF
|| GET_CODE (XEXP (SET_SRC (x), 1)) == LABEL_REF))
|| ((note = find_reg_note (insn, REG_EQUAL, 0)) != 0
&& (GET_CODE (XEXP (note, 0)) == CONST
|| GET_CODE (XEXP (note, 0)) == SYMBOL_REF
|| GET_CODE (XEXP (note, 0)) == LABEL_REF))))
function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to... * function.h (emit_status): Delete member regno_pointer_flag and rename regno_pointer_flag_length to regno_pointer_align_length. Delete define for REGNO_POINTER_FLAG. * integrate.h (inline_remap): Delete member regno_pointer_flag. Add member x_regno_reg_rtx. * rtl.h (rtx_def): Use frame_related bit to indicate register is a pointer in REG expressions. Define REG_POINTER macro. * alias.c (find_base_value, find_base_term): Use REG_POINTER instead of REGNO_POINTER_FLAG. * combine.c (nonzero_bits, num_sign_bit_copies): Likewise. * emit-rtl.c (gen_reg_rtx): Use regno_pointer_align_length instead of regno_pointer_flag_length. Remove code which refers to regno_pointer_flag. (mark_reg_pointer): Use REG_POINTER. (free_emit_status): Remove code which refers to regno_pointer_flag. (init_emit, mark_emit_status): Likewise. * flow.c (dump_flow_info): Likewise. * function.c (preserve_temp_slots): Likewise. * integrate.c (expand_inline_function, copy_rtx_and_substitute): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * loop.c (strength_reduce, maybe_eliminate_biv_1): Use REG_POINTER. * predict.c (estimate_probability): Likewise. * regclass.c (record_address_regs, reg_scan_mark_refs): Likewise. * unroll.c (unroll_loop): Use x_regno_reg_rtx instead of regno_pointer_flag for function pointer determination in map. * convex.h (RTX_COSTS): Don't test regno_pointer_flag and use REG_POINTER. * pa.c (hppa_legitimize_address, emit_move_sequence, basereg_operand): Use REG_POINTER. (restore_unscaled_index_insn_codes): Revise comment. From-SVN: r37863
2000-11-30 07:31:19 +01:00
REG_POINTER (SET_DEST (x)) = 1;
/* If this is setting a register from a register or from a simple
conversion of a register, propagate REG_EXPR. */
if (REG_P (dest) && !REG_ATTRS (dest))
{
rtx src = SET_SRC (x);
while (GET_CODE (src) == SIGN_EXTEND
|| GET_CODE (src) == ZERO_EXTEND
|| GET_CODE (src) == TRUNCATE
|| (GET_CODE (src) == SUBREG && subreg_lowpart_p (src)))
src = XEXP (src, 0);
rtl.def (SUBREG): Update comments. gcc/ * rtl.def (SUBREG): Update comments. * rtl.h (reg_attrs): Be explicit about the type of offset used. (set_reg_attrs_from_mem): Rename to... (set_reg_attrs_from_value): ...this. (adjust_reg_mode, byte_lowpart_offset): Declare. * emit-rtl.c (byte_lowpart_offset): New function. (update_reg_offset): Remove special offset handling for big-endian targets. (gen_rtx_REG_offset, gen_reg_rtx_offset): Explicitly say that the offset parameter is added to REG_OFFSET. (adjust_reg_mode): New function. (set_reg_attrs_for_mem): Rename to... (set_reg_attrs_for_value): ...this and generalize to all values. If the register is a lowpart of the value, adjust the offset accordingly. (set_reg_attrs_for_parm): Update after the above renaming. (set_reg_attrs_for_decl_rtl): New function, split out from set_decl_incoming_rtl. Set the offset of plain REGs to the offset of the REG's mode from the decl's. Assert that all subregs are lowparts and handle their inner registers in the same way as plain REGs. (set_decl_rtl, set_incoming_decl_rtl): Use reg_attrs_for_decl_rtl. (subreg_lowpart_offset): Explicitly say that the returned offset is a SUBREG_BYTE. * combine.c (do_SUBST_MODE, try_combine, undo_all): Use adjust_reg_mode instead of PUT_MODE. * final.c (alter_subreg): Fix/update argument to gen_rtx_REG_offset. * config/ia64/ia64.c (ia64_expand_load_address): Likewise. * regclass.c (reg_scan_mark_refs): Use set_reg_attrs_from_value. * reload.c (find_reloads_subreg_address): Call set_mem_offset when offseting a MEM. * var-tracking.c (offset_valid_for_tracked_p): Delete. (mode_for_reg_attrs): Replace with... (track_loc_p): ...this new function. Return the mode and offset to the caller, checking that the latter is valid. If the rtx is a paradoxical lowpart of the decl, use the decl's mode instead. Do the same when storing to a register that contains the entire decl. (var_lowpart): Use byte_lowpart_offset rather than subreg_lowpart_offset when adjusting the offset attribute. (count_uses, add_uses, add_stores): Use track_reg_p instead of REG_EXPR, MEM_EXPR, REG_OFFSET, INT_MEM_OFFSET, track_expr_p, offset_valid_for_tracked_p and mode_for_reg_attrs. Generate lowparts for MEMs as well as REGs. (vt_add_function_parameters): When obtaining the information from the decl_rtl, adjust the offset to match incoming. Use track_loc_p and var_lowpart. From-SVN: r131055
2007-12-19 10:54:24 +01:00
set_reg_attrs_from_value (dest, src);
}
1996-07-04 00:07:53 +02:00
/* ... fall through ... */
1991-11-06 00:39:50 +01:00
default:
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
const char *fmt = GET_RTX_FORMAT (code);
int i;
1991-11-06 00:39:50 +01:00
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
reg_scan_mark_refs (XEXP (x, i), insn);
1991-11-06 00:39:50 +01:00
else if (fmt[i] == 'E' && XVEC (x, i) != 0)
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
int j;
1991-11-06 00:39:50 +01:00
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
reg_scan_mark_refs (XVECEXP (x, i, j), insn);
1991-11-06 00:39:50 +01:00
}
}
}
}
}
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
1991-11-06 00:39:50 +01:00
/* Return nonzero if C1 is a subset of C2, i.e., if every register in C1
is also in C2. */
int
reg_class_subset_p (enum reg_class c1, enum reg_class c2)
1991-11-06 00:39:50 +01:00
{
return (c1 == c2
|| c2 == ALL_REGS
|| hard_reg_set_subset_p (reg_class_contents[(int) c1],
reg_class_contents[(int) c2]));
1991-11-06 00:39:50 +01:00
}
/* Return nonzero if there is a register that is in both C1 and C2. */
int
reg_classes_intersect_p (enum reg_class c1, enum reg_class c2)
1991-11-06 00:39:50 +01:00
{
return (c1 == c2
|| c1 == ALL_REGS
|| c2 == ALL_REGS
|| hard_reg_set_intersect_p (reg_class_contents[(int) c1],
reg_class_contents[(int) c2]));
1991-11-06 00:39:50 +01:00
}
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
/* Passes for keeping and updating info about modes of registers
inside subregisters. */
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
#ifdef CANNOT_CHANGE_MODE_CLASS
struct subregs_of_mode_node
{
unsigned int block;
unsigned char modes[MAX_MACHINE_MODE];
};
static htab_t subregs_of_mode;
static hashval_t
som_hash (const void *x)
{
ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * recog.c (check_asm_operands, validate_change_1): Likewise. * reg-stack.c (check_asm_stack_operands, subst_asm_stack_regs, subst_asm_stack_regs): Likewise. * regclass.c (regclass, som_hash, som_eq, record_subregs_of_mode, cannot_change_mode_set_regs, invalid_mode_change_p): Likewise. * regmove.c (reg_is_remote_constant_p): Likewise. * regrename.c (regrename_optimize, scan_rtx_reg, kill_clobbered_value, kill_set_value, kill_autoinc_value): Likewise. * regstat.c (regstat_init_n_sets_and_refs, regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (init_reload, new_insn_chain, has_nonexceptional_receiver, reload, copy_reloads, calculate_needs_all_insns, init_elim_table): Likewise. * rtl-factoring.c (compute_rtx_cost, fill_hash_bucket): Likewise. * rtl.c (shallow_copy_rtx_stat): Likewise. * rtlanal.c (parms_set): Likewise. * sbitmap.c (sbitmap_alloc, sbitmap_alloc_with_popcount, sbitmap_resize, sbitmap_vector_alloc): Likewise. * sched-ebb.c (earliest_block_with_similiar_load, add_deps_for_risky_insns): Likewise. * sched-rgn.c (find_rgns, gather_region_statistics, extend_rgns, schedule_region): Likewise. * see.c (eq_descriptor_pre_extension, hash_descriptor_pre_extension, hash_del_pre_extension, eq_descriptor_properties, hash_descriptor_properties, hash_del_properties, see_seek_pre_extension_expr, see_initialize_data_structures, see_print_register_properties, see_print_pre_extension_expr, see_delete_merged_def_extension, see_delete_unmerged_def_extension, see_emit_use_extension, see_pre_delete_extension, see_map_extension, see_commit_changes, see_analyze_merged_def_local_prop, see_analyze_merged_def_local_prop, see_analyze_unmerged_def_local_prop, see_analyze_use_local_prop, see_set_prop_merged_def, see_set_prop_unmerged_def, see_set_prop_unmerged_use, see_print_one_extension, see_merge_one_use_extension, see_merge_one_def_extension, see_store_reference_and_extension, see_update_uses_relevancy, see_update_defs_relevancy): Likewise. * statistics.c (hash_statistics_hash, hash_statistics_eq, hash_statistics_free, curr_statistics_hash): Likewise. * stmt.c (parse_output_constraint, decl_overlaps_hard_reg_set_p, expand_asm_operands, expand_return, case_bit_test_cmp, expand_case): Likewise. * stor-layout.c (start_record_layout): Likewise. * stringpool.c (ggc_alloc_string, gt_pch_n_S, gt_pch_save_stringpool): Likewise. * tree-data-ref.c (hash_stmt_vertex_info, have_similar_memory_accesses_1, ref_base_address_1): Likewise. * tree-ssa-phiopt.c (name_to_bb_hash): Likewise. From-SVN: r137128
2008-06-26 02:12:56 +02:00
const struct subregs_of_mode_node *const a =
(const struct subregs_of_mode_node *) x;
return a->block;
}
static int
som_eq (const void *x, const void *y)
{
ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * recog.c (check_asm_operands, validate_change_1): Likewise. * reg-stack.c (check_asm_stack_operands, subst_asm_stack_regs, subst_asm_stack_regs): Likewise. * regclass.c (regclass, som_hash, som_eq, record_subregs_of_mode, cannot_change_mode_set_regs, invalid_mode_change_p): Likewise. * regmove.c (reg_is_remote_constant_p): Likewise. * regrename.c (regrename_optimize, scan_rtx_reg, kill_clobbered_value, kill_set_value, kill_autoinc_value): Likewise. * regstat.c (regstat_init_n_sets_and_refs, regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (init_reload, new_insn_chain, has_nonexceptional_receiver, reload, copy_reloads, calculate_needs_all_insns, init_elim_table): Likewise. * rtl-factoring.c (compute_rtx_cost, fill_hash_bucket): Likewise. * rtl.c (shallow_copy_rtx_stat): Likewise. * rtlanal.c (parms_set): Likewise. * sbitmap.c (sbitmap_alloc, sbitmap_alloc_with_popcount, sbitmap_resize, sbitmap_vector_alloc): Likewise. * sched-ebb.c (earliest_block_with_similiar_load, add_deps_for_risky_insns): Likewise. * sched-rgn.c (find_rgns, gather_region_statistics, extend_rgns, schedule_region): Likewise. * see.c (eq_descriptor_pre_extension, hash_descriptor_pre_extension, hash_del_pre_extension, eq_descriptor_properties, hash_descriptor_properties, hash_del_properties, see_seek_pre_extension_expr, see_initialize_data_structures, see_print_register_properties, see_print_pre_extension_expr, see_delete_merged_def_extension, see_delete_unmerged_def_extension, see_emit_use_extension, see_pre_delete_extension, see_map_extension, see_commit_changes, see_analyze_merged_def_local_prop, see_analyze_merged_def_local_prop, see_analyze_unmerged_def_local_prop, see_analyze_use_local_prop, see_set_prop_merged_def, see_set_prop_unmerged_def, see_set_prop_unmerged_use, see_print_one_extension, see_merge_one_use_extension, see_merge_one_def_extension, see_store_reference_and_extension, see_update_uses_relevancy, see_update_defs_relevancy): Likewise. * statistics.c (hash_statistics_hash, hash_statistics_eq, hash_statistics_free, curr_statistics_hash): Likewise. * stmt.c (parse_output_constraint, decl_overlaps_hard_reg_set_p, expand_asm_operands, expand_return, case_bit_test_cmp, expand_case): Likewise. * stor-layout.c (start_record_layout): Likewise. * stringpool.c (ggc_alloc_string, gt_pch_n_S, gt_pch_save_stringpool): Likewise. * tree-data-ref.c (hash_stmt_vertex_info, have_similar_memory_accesses_1, ref_base_address_1): Likewise. * tree-ssa-phiopt.c (name_to_bb_hash): Likewise. From-SVN: r137128
2008-06-26 02:12:56 +02:00
const struct subregs_of_mode_node *const a =
(const struct subregs_of_mode_node *) x;
const struct subregs_of_mode_node *const b =
(const struct subregs_of_mode_node *) y;
return a->block == b->block;
}
static void
record_subregs_of_mode (rtx subreg)
{
struct subregs_of_mode_node dummy, *node;
enum machine_mode mode;
unsigned int regno;
void **slot;
if (!REG_P (SUBREG_REG (subreg)))
return;
regno = REGNO (SUBREG_REG (subreg));
mode = GET_MODE (subreg);
if (regno < FIRST_PSEUDO_REGISTER)
return;
dummy.block = regno & -8;
slot = htab_find_slot_with_hash (subregs_of_mode, &dummy,
dummy.block, INSERT);
ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * recog.c (check_asm_operands, validate_change_1): Likewise. * reg-stack.c (check_asm_stack_operands, subst_asm_stack_regs, subst_asm_stack_regs): Likewise. * regclass.c (regclass, som_hash, som_eq, record_subregs_of_mode, cannot_change_mode_set_regs, invalid_mode_change_p): Likewise. * regmove.c (reg_is_remote_constant_p): Likewise. * regrename.c (regrename_optimize, scan_rtx_reg, kill_clobbered_value, kill_set_value, kill_autoinc_value): Likewise. * regstat.c (regstat_init_n_sets_and_refs, regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (init_reload, new_insn_chain, has_nonexceptional_receiver, reload, copy_reloads, calculate_needs_all_insns, init_elim_table): Likewise. * rtl-factoring.c (compute_rtx_cost, fill_hash_bucket): Likewise. * rtl.c (shallow_copy_rtx_stat): Likewise. * rtlanal.c (parms_set): Likewise. * sbitmap.c (sbitmap_alloc, sbitmap_alloc_with_popcount, sbitmap_resize, sbitmap_vector_alloc): Likewise. * sched-ebb.c (earliest_block_with_similiar_load, add_deps_for_risky_insns): Likewise. * sched-rgn.c (find_rgns, gather_region_statistics, extend_rgns, schedule_region): Likewise. * see.c (eq_descriptor_pre_extension, hash_descriptor_pre_extension, hash_del_pre_extension, eq_descriptor_properties, hash_descriptor_properties, hash_del_properties, see_seek_pre_extension_expr, see_initialize_data_structures, see_print_register_properties, see_print_pre_extension_expr, see_delete_merged_def_extension, see_delete_unmerged_def_extension, see_emit_use_extension, see_pre_delete_extension, see_map_extension, see_commit_changes, see_analyze_merged_def_local_prop, see_analyze_merged_def_local_prop, see_analyze_unmerged_def_local_prop, see_analyze_use_local_prop, see_set_prop_merged_def, see_set_prop_unmerged_def, see_set_prop_unmerged_use, see_print_one_extension, see_merge_one_use_extension, see_merge_one_def_extension, see_store_reference_and_extension, see_update_uses_relevancy, see_update_defs_relevancy): Likewise. * statistics.c (hash_statistics_hash, hash_statistics_eq, hash_statistics_free, curr_statistics_hash): Likewise. * stmt.c (parse_output_constraint, decl_overlaps_hard_reg_set_p, expand_asm_operands, expand_return, case_bit_test_cmp, expand_case): Likewise. * stor-layout.c (start_record_layout): Likewise. * stringpool.c (ggc_alloc_string, gt_pch_n_S, gt_pch_save_stringpool): Likewise. * tree-data-ref.c (hash_stmt_vertex_info, have_similar_memory_accesses_1, ref_base_address_1): Likewise. * tree-ssa-phiopt.c (name_to_bb_hash): Likewise. From-SVN: r137128
2008-06-26 02:12:56 +02:00
node = (struct subregs_of_mode_node *) *slot;
if (node == NULL)
{
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
node = XCNEW (struct subregs_of_mode_node);
node->block = regno & -8;
*slot = node;
}
node->modes[mode] |= 1 << (regno & 7);
}
/* Call record_subregs_of_mode for all the subregs in X. */
static void
find_subregs_of_mode (rtx x)
{
enum rtx_code code = GET_CODE (x);
const char * const fmt = GET_RTX_FORMAT (code);
int i;
if (code == SUBREG)
record_subregs_of_mode (x);
/* Time for some deep diving. */
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
find_subregs_of_mode (XEXP (x, i));
else if (fmt[i] == 'E')
{
int j;
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
find_subregs_of_mode (XVECEXP (x, i, j));
}
}
}
static unsigned int
init_subregs_of_mode (void)
{
basic_block bb;
rtx insn;
if (subregs_of_mode)
htab_empty (subregs_of_mode);
else
subregs_of_mode = htab_create (100, som_hash, som_eq, free);
FOR_EACH_BB (bb)
FOR_BB_INSNS (bb, insn)
if (INSN_P (insn))
find_subregs_of_mode (PATTERN (insn));
return 0;
}
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
/* Return 1 if REGNO has had an invalid mode change in CLASS from FROM
mode. */
bool
invalid_mode_change_p (unsigned int regno,
enum reg_class rclass ATTRIBUTE_UNUSED,
enum machine_mode from)
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
{
struct subregs_of_mode_node dummy, *node;
unsigned int to;
unsigned char mask;
gcc_assert (subregs_of_mode);
dummy.block = regno & -8;
ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * ra.h (add_neighbor): Fix -Wc++-compat and/or -Wcast-qual warnings. * recog.c (check_asm_operands, validate_change_1): Likewise. * reg-stack.c (check_asm_stack_operands, subst_asm_stack_regs, subst_asm_stack_regs): Likewise. * regclass.c (regclass, som_hash, som_eq, record_subregs_of_mode, cannot_change_mode_set_regs, invalid_mode_change_p): Likewise. * regmove.c (reg_is_remote_constant_p): Likewise. * regrename.c (regrename_optimize, scan_rtx_reg, kill_clobbered_value, kill_set_value, kill_autoinc_value): Likewise. * regstat.c (regstat_init_n_sets_and_refs, regstat_compute_ri, regstat_compute_calls_crossed): Likewise. * reload1.c (init_reload, new_insn_chain, has_nonexceptional_receiver, reload, copy_reloads, calculate_needs_all_insns, init_elim_table): Likewise. * rtl-factoring.c (compute_rtx_cost, fill_hash_bucket): Likewise. * rtl.c (shallow_copy_rtx_stat): Likewise. * rtlanal.c (parms_set): Likewise. * sbitmap.c (sbitmap_alloc, sbitmap_alloc_with_popcount, sbitmap_resize, sbitmap_vector_alloc): Likewise. * sched-ebb.c (earliest_block_with_similiar_load, add_deps_for_risky_insns): Likewise. * sched-rgn.c (find_rgns, gather_region_statistics, extend_rgns, schedule_region): Likewise. * see.c (eq_descriptor_pre_extension, hash_descriptor_pre_extension, hash_del_pre_extension, eq_descriptor_properties, hash_descriptor_properties, hash_del_properties, see_seek_pre_extension_expr, see_initialize_data_structures, see_print_register_properties, see_print_pre_extension_expr, see_delete_merged_def_extension, see_delete_unmerged_def_extension, see_emit_use_extension, see_pre_delete_extension, see_map_extension, see_commit_changes, see_analyze_merged_def_local_prop, see_analyze_merged_def_local_prop, see_analyze_unmerged_def_local_prop, see_analyze_use_local_prop, see_set_prop_merged_def, see_set_prop_unmerged_def, see_set_prop_unmerged_use, see_print_one_extension, see_merge_one_use_extension, see_merge_one_def_extension, see_store_reference_and_extension, see_update_uses_relevancy, see_update_defs_relevancy): Likewise. * statistics.c (hash_statistics_hash, hash_statistics_eq, hash_statistics_free, curr_statistics_hash): Likewise. * stmt.c (parse_output_constraint, decl_overlaps_hard_reg_set_p, expand_asm_operands, expand_return, case_bit_test_cmp, expand_case): Likewise. * stor-layout.c (start_record_layout): Likewise. * stringpool.c (ggc_alloc_string, gt_pch_n_S, gt_pch_save_stringpool): Likewise. * tree-data-ref.c (hash_stmt_vertex_info, have_similar_memory_accesses_1, ref_base_address_1): Likewise. * tree-ssa-phiopt.c (name_to_bb_hash): Likewise. From-SVN: r137128
2008-06-26 02:12:56 +02:00
node = (struct subregs_of_mode_node *)
htab_find_with_hash (subregs_of_mode, &dummy, dummy.block);
if (node == NULL)
return false;
mask = 1 << (regno & 7);
for (to = VOIDmode; to < NUM_MACHINE_MODES; to++)
if (node->modes[to] & mask)
if (CANNOT_CHANGE_MODE_CLASS (from, (enum machine_mode) to, rclass))
return true;
return false;
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
}
static unsigned int
finish_subregs_of_mode (void)
{
htab_delete (subregs_of_mode);
subregs_of_mode = 0;
return 0;
}
#else
static unsigned int
init_subregs_of_mode (void)
{
return 0;
}
static unsigned int
finish_subregs_of_mode (void)
{
return 0;
}
hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. 2002-11-04 Aldy Hernandez <aldyh@redhat.com> * hard-reg-set.h (REG_CANNOT_CHANGE_MODE_P): New. * config/rs6000/rs6000.h (CLASS_CANNOT_CHANGE_MODE_P): Remove. (CLASS_CANNOT_CHANGE_MODE): Remove. (CANNOT_CHANGE_MODE_CLASS): New. * config/alpha/alpha.h: Same. * config/ia64/ia64.h: Same. * config/mips/mips.h: Same. * config/s390/s390.h: Same. * config/sh/sh.h: Same. * config/pa/pa64-regs.h: Same. * config/sh/sh-protos.h (sh_cannot_change_mode_class): Add prototype. * config/sh/sh.c (sh_cannot_change_mode_class): New. * config/mips/mips-protos.h (mips_cannot_change_mode_class): Add prototype. * config/mips/mips.c (mips_cannot_change_mode_class): New. * doc/tm.texi (Register Classes): Remove CLASS_CANNOT_CHANGE_MODE and CLASS_CANNOT_CHANGE_MODE_P. Document CANNOT_CHANGE_MODE_CLASS. * reload.c (push_reload): Use CANNOT_CHANGE_MODE_CLASS. (push_reload): Same. * simplify-rtx.c (simplify_subreg): Same. * reload1.c (choose_reload_regs): Same. * recog.c (register_operand): Same. * regrename.c (mode_change_ok): Change to use new CANNOT_CHANGE_MODE_CLASS infrastructure. * regclass.c (cannot_change_mode_set_regs): New. Declare subregs_of_mode. (regclass): Use subregs_of_mode. Remove references to reg_changes_mode. (init_reg_sets_1): Remove class_can_change_mode and reg_changes_mode code. (invalid_mode_change_p): New. (dump_regclass): Use invalid_mode_change_p instead of class_can_change_mode. (regclass): Same. (record_operand_costs): Do not set reg_changes_mode. * local-alloc.c (struct qty): Remove changes_mode field. (alloc_qty): Remove changes_mode initialization. (update_qty_class): Remove set of changes_mode. (find_free_reg): Use subregs_of_mode. * global.c (find_reg): Use subregs_of_mode info. * rtl.h (cannot_change_mode_set_regs): New prototype. (invalid_mode_change_p): Same. (REG_CANNOT_CHANGE_MODE_P): New macro. * flow.c (mark_used_regs): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. (life_analysis): Clear subregs_of_mode. * combine.c (subst): Pass class to CLASS_CANNOT_CHANGE_MODE_P. Remove use of CLASS_CANNOT_CHANGE_MODE. (simplify_set): Same. (gen_lowpart_for_combine): Calculate subregs_of_mode. Remove REG_CHANGES_MODE. * regs.h: Add extern for subregs_of_mode; Include hard-reg-set and basic-block. (REG_CHANGES_MODE): Delete. From-SVN: r58794
2002-11-04 17:58:39 +01:00
#endif /* CANNOT_CHANGE_MODE_CLASS */
static bool
gate_subregs_of_mode_init (void)
{
#ifdef CANNOT_CHANGE_MODE_CLASS
return true;
#else
return false;
#endif
}
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
struct rtl_opt_pass pass_subregs_of_mode_init =
{
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
{
RTL_PASS,
"subregs_of_mode_init", /* name */
gate_subregs_of_mode_init, /* gate */
init_subregs_of_mode, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
df.h: Include "timevar.h". * df.h: Include "timevar.h". (struct df_problem): Change tv_id field to timevar_id_t. * tree-pass.h: Include "timevar.h". (struct opt_pass): Change tv_id field to timevar_id_t. * timevar.h (timevar_id_t): Define TV_NONE. * passes.c (execute_one_ipa_transform_pass): Check for tv_id != TV_NONE rather than tv_id != 0. (execute_one_pass): Likewise. * Makefile.in (DF_H): Add $(TIMEVAR_H). (TREE_PASS_H): Define. Change all instances of tree-pass.h in dependencies to $(TREE_PASS_H). * bt-load.c (pass_branch_target_load_optimize1): Set tv_id field to TV_NONE. (pass_branch_target_load_optimize2): Likewise. * cfglayout.c (pass_into_cfg_layout_mode): Likewise. (pass_outof_cfg_layout_mode): Likewise. * cgraphbuild.c (pass_remove_cgraph_callee_edges): Likewise. (pass_rebuild_cgraph_edges): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * df-core.c (pass_df_initialize_opt): Likewise. (pass_df_initialize_no_opt): Likewise. (pass_df_finish): Likewise. * emit-rtl.c (pass_unshare_all_rtl): Likewise. * except.c (pass_set_nothrow_function_flags): Likewise. (pass_convert_to_eh_region_ranges): Likewise. * final.c (pass_compute_alignments): Likewise. * function.c (pass_instantiate_virtual_regs): Likewise. (pass_init_function): Likewise. (pass_leaf_regs): Likewise. (pass_match_asm_constraints): Likewise. * gimple-low.c (pass_lower_cf): Likewise. (pass_mark_used_blocks): Likewise. * init-regs.c (pass_initialize_regs): Likewise. * integrate.c (pass_initial_value_sets): Likewise. * ira.c (pass_ira): Likewise. * jump.c (pass_cleanup_barriers): Likewise. * omp-low.c (pass_expand_omp): Likewise. (pass_lower_omp): Likewise. * matrix-reorg.c (pass_ipa_matrix_reorg): Likewise. * recog.c (pass_split_all_insns): Likewise. (pass_split_after_reload): Likewise. (pass_split_before_regstack): Likewise. (pass_split_before_sched2): Likewise. (pass_split_for_shorten_branches): Likewise. * reginfo.c (pass_reginfo_init): Likewise. (pass_subregs_of_mode_init): Likewise. (pass_subregs_of_mode_finish): Likewise. * passes.c (pass_postreload): Likewise. * stack-ptr-mod.c (pass_stack_ptr_mod): Likewise. * tree-cfg.c (pass_remove_useless_stmts): Likewise. (pass_warn_function_return): Likewise. (pass_warn_function_noreturn): Likewise. * tree-complex.c (pass_lower_complex): Likewise. (pass_lower_complex_O0): Likewise. * tree-if-conv.c (pass_if_conversion): Likewise. * tree-into-ssa.c (pass_build_ssa): Likewise. * tree-mudflap.c (pass_mudflap_1): Likewise. (pass_mudflap_2): Likewise. * tree-nomudflap.c (pass_mudflap_1): Likewise. (pass_mudflap_2): Likewise. * tree-nrv.c (pass_return_slot): Likewise. * tree-object-size.c (pass_object_sizes): Likewise. * tree-optimize.c (pass_all_optimizations): Likewise. (pass_early_local_passes): Likewise. (pass_all_early_optimizations): Likewise. (pass_cleanup_cfg): Likewise. (pass_cleanup_cfg_post_optimizing): Likewise. (pass_free_datastructures): Likewise. (pass_free_cfg_annotations): Likewise. (pass_fixup_cfg): Likewise. (pass_init_datastructures): Likewise. * tree-ssa.c (pass_early_warn_uninitialized): Likewise. (pass_late_warn_uninitialized): Likewise. (pass_update_address_taken): Likewise. * tree-ssa-ccp.c (pass_fold_builtins): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals): Likewise. (pass_cse_sincos): Likewise. (pass_convert_to_rsqrt): Likewise. * tree-ssa-structalias.c (pass_build_alias): Likewise. * tree-stdarg.c (pass_stdarg): Likewise. * tree-tailcall.c (pass_tail_recursion): Likewise. (pass_tail_calls): Likewise. * tree-vect-generic.c (pass_lower_vector): Likewise. (pass_lower_vector_ssa): Likewise. * tree-vectorizer.c (pass_ipa_increase_alignment): Likewise. From-SVN: r146222
2009-04-17 07:40:46 +02:00
TV_NONE, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
0 /* todo_flags_finish */
}
};
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
struct rtl_opt_pass pass_subregs_of_mode_finish =
{
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
{
RTL_PASS,
"subregs_of_mode_finish", /* name */
gate_subregs_of_mode_init, /* gate */
finish_subregs_of_mode, /* execute */
NULL, /* sub */
NULL, /* next */
0, /* static_pass_number */
df.h: Include "timevar.h". * df.h: Include "timevar.h". (struct df_problem): Change tv_id field to timevar_id_t. * tree-pass.h: Include "timevar.h". (struct opt_pass): Change tv_id field to timevar_id_t. * timevar.h (timevar_id_t): Define TV_NONE. * passes.c (execute_one_ipa_transform_pass): Check for tv_id != TV_NONE rather than tv_id != 0. (execute_one_pass): Likewise. * Makefile.in (DF_H): Add $(TIMEVAR_H). (TREE_PASS_H): Define. Change all instances of tree-pass.h in dependencies to $(TREE_PASS_H). * bt-load.c (pass_branch_target_load_optimize1): Set tv_id field to TV_NONE. (pass_branch_target_load_optimize2): Likewise. * cfglayout.c (pass_into_cfg_layout_mode): Likewise. (pass_outof_cfg_layout_mode): Likewise. * cgraphbuild.c (pass_remove_cgraph_callee_edges): Likewise. (pass_rebuild_cgraph_edges): Likewise. (pass_remove_cgraph_callee_edges): Likewise. * df-core.c (pass_df_initialize_opt): Likewise. (pass_df_initialize_no_opt): Likewise. (pass_df_finish): Likewise. * emit-rtl.c (pass_unshare_all_rtl): Likewise. * except.c (pass_set_nothrow_function_flags): Likewise. (pass_convert_to_eh_region_ranges): Likewise. * final.c (pass_compute_alignments): Likewise. * function.c (pass_instantiate_virtual_regs): Likewise. (pass_init_function): Likewise. (pass_leaf_regs): Likewise. (pass_match_asm_constraints): Likewise. * gimple-low.c (pass_lower_cf): Likewise. (pass_mark_used_blocks): Likewise. * init-regs.c (pass_initialize_regs): Likewise. * integrate.c (pass_initial_value_sets): Likewise. * ira.c (pass_ira): Likewise. * jump.c (pass_cleanup_barriers): Likewise. * omp-low.c (pass_expand_omp): Likewise. (pass_lower_omp): Likewise. * matrix-reorg.c (pass_ipa_matrix_reorg): Likewise. * recog.c (pass_split_all_insns): Likewise. (pass_split_after_reload): Likewise. (pass_split_before_regstack): Likewise. (pass_split_before_sched2): Likewise. (pass_split_for_shorten_branches): Likewise. * reginfo.c (pass_reginfo_init): Likewise. (pass_subregs_of_mode_init): Likewise. (pass_subregs_of_mode_finish): Likewise. * passes.c (pass_postreload): Likewise. * stack-ptr-mod.c (pass_stack_ptr_mod): Likewise. * tree-cfg.c (pass_remove_useless_stmts): Likewise. (pass_warn_function_return): Likewise. (pass_warn_function_noreturn): Likewise. * tree-complex.c (pass_lower_complex): Likewise. (pass_lower_complex_O0): Likewise. * tree-if-conv.c (pass_if_conversion): Likewise. * tree-into-ssa.c (pass_build_ssa): Likewise. * tree-mudflap.c (pass_mudflap_1): Likewise. (pass_mudflap_2): Likewise. * tree-nomudflap.c (pass_mudflap_1): Likewise. (pass_mudflap_2): Likewise. * tree-nrv.c (pass_return_slot): Likewise. * tree-object-size.c (pass_object_sizes): Likewise. * tree-optimize.c (pass_all_optimizations): Likewise. (pass_early_local_passes): Likewise. (pass_all_early_optimizations): Likewise. (pass_cleanup_cfg): Likewise. (pass_cleanup_cfg_post_optimizing): Likewise. (pass_free_datastructures): Likewise. (pass_free_cfg_annotations): Likewise. (pass_fixup_cfg): Likewise. (pass_init_datastructures): Likewise. * tree-ssa.c (pass_early_warn_uninitialized): Likewise. (pass_late_warn_uninitialized): Likewise. (pass_update_address_taken): Likewise. * tree-ssa-ccp.c (pass_fold_builtins): Likewise. * tree-ssa-math-opts.c (pass_cse_reciprocals): Likewise. (pass_cse_sincos): Likewise. (pass_convert_to_rsqrt): Likewise. * tree-ssa-structalias.c (pass_build_alias): Likewise. * tree-stdarg.c (pass_stdarg): Likewise. * tree-tailcall.c (pass_tail_recursion): Likewise. (pass_tail_calls): Likewise. * tree-vect-generic.c (pass_lower_vector): Likewise. (pass_lower_vector_ssa): Likewise. * tree-vectorizer.c (pass_ipa_increase_alignment): Likewise. From-SVN: r146222
2009-04-17 07:40:46 +02:00
TV_NONE, /* tv_id */
0, /* properties_required */
0, /* properties_provided */
0, /* properties_destroyed */
0, /* todo_flags_start */
re PR other/35094 (RTL dump file letters hosed and partly undocumented) * gcc.dg/20050811-2.c: Update dumping flags. * gcc.dg/sms-2.c: Update dumping flags. * gcc.dg/var-expand1.c: Update dumping flags. * gcc.dg/var-expand3.c: Update dumping flags. * gcc.dg/pr30957-1.c: Update dumping flags. * gcc.dg/20050811-1.c: Update dumping flags. * gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail. * gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail. PR other/35094 * toplev.c (decode_d_option): Handle all CPP flags. * tree-vrp.c: Update tree_pass descriptors. * regrename.c: Update tree_pass descriptors. * fwprop.c: Update tree_pass descriptors. * doc/invoke.texi: Remove documentation of dropped -d? flags. * tree-into-ssa.c: Update tree_pass descriptors. * tree-dump.c: Update tree_pass descriptors. * tree-complex.c: Update tree_pass descriptors. * tree-dump.h: Update tree_pass descriptors. * see.c: Update tree_pass descriptors. * cgraphbuild.c: Update tree_pass descriptors. * tracer.c: Update tree_pass descriptors. * tree-loop-distribution.c: Update tree_pass descriptors. * cgraph.c: Update tree_pass descriptors. * postreload-gcse.c: Update tree_pass descriptors. * postreload.c: Update tree_pass descriptors. * tree-ssa-loop-ch.c: Update tree_pass descriptors. * tree-tailcall.c: Update tree_pass descriptors. * tree-pass.h (tree_opt_pass): Rename to ... (opt_pass) ... this one; add "type" field and remove letter field. (gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New. (execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes, all_lowering_passes): Update declaration. * ipa-cp.c: Update tree_pass descriptors. * final.c: Update tree_pass descriptors. * omp-low.c: Update tree_pass descriptors. * tree-ssa-dse.c: Update tree_pass descriptors. * ipa-reference.c: Update tree_pass descriptors. * tree-ssa-uncprop.c: Update tree_pass descriptors. * auto-inc-dec.c: Update tree_pass descriptors. * reorg.c: Update tree_pass descriptors. * cgraphunit.c: Update tree_pass descriptors. * tree-ssa-copyrename.c: Update tree_pass descriptors. * tree-ssa-ccp.c: Update tree_pass descriptors. * df-core.c: Update tree_pass descriptors. * mode-switching.c: Update tree_pass descriptors. * tree-nomudflap.c: Update tree_pass descriptors. * modulo-sched.c: Update tree_pass descriptors. * ipa-pure-const.c: Update tree_pass descriptors. * cse.c: Update tree_pass descriptors. * web.c: Update tree_pass descriptors. * tree-stdarg.c: Update tree_pass descriptors. * tree-ssa-math-opts.c: Update tree_pass descriptors. * tree-ssa-dom.c: Update tree_pass descriptors. * tree-nrv.c: Update tree_pass descriptors. * tree-ssa-alias.c: Update tree_pass descriptors. * loop-init.c: Update tree_pass descriptors. * gimple-low.c: Update tree_pass descriptors. * ipa-inline.c: Update tree_pass descriptors. * tree-ssa-sink.c: Update tree_pass descriptors. * global.c: Update tree_pass descriptors. * ifcvt.c: Update tree_pass descriptors. * jump.c: Update tree_pass descriptors. * predict.c: Update tree_pass descriptors. * tree-ssa-loop.c: Update tree_pass descriptors. * recog.c: Update tree_pass descriptors. * dse.c: Update tree_pass descriptors. * tree-ssa-ifcombine.c: Update tree_pass descriptors. * tree-eh.c: Update tree_pass descriptors. * regmove.c: Update tree_pass descriptors. * local-alloc.c * function.c: Update tree_pass descriptors. * tree-vectorizer.c: Update tree_pass descriptors. * gcse.c: Update tree_pass descriptors. * ipa-type-escape.c: Update tree_pass descriptors. * tree-if-conv.c: Update tree_pass descriptors. * init-regs.c: Update tree_pass descriptors. * ipa.c: Update tree_pass descriptors. * tree-ssa-phiopt.c: Update tree_pass descriptors. * rtl-factoring.c: Update tree_pass descriptors. * lower-subreg.c: Update tree_pass descriptors. * bt-load.c: Update tree_pass descriptors. * tree-dfa.c: Update tree_pass descriptors. * except.c: Update tree_pass descriptors. * emit-rtl.c: Update tree_pass descriptors. * cfgexpand.c: Update tree_pass descriptors. * tree-cfgcleanup.c: Update tree_pass descriptors. * cfgcleanup.c: Update tree_pass descriptors. * tree-ssa-pre.c: Update tree_pass descriptors. * tree-sra.c: Update tree_pass descriptors. * tree-mudflap.c: Update tree_pass descriptors. * tree-ssa-copy.c: Update tree_pass descriptors. * cfglayout.c: Update tree_pass descriptors. * tree-ssa-forwprop.c: Update tree_pass descriptors. * tree-ssa-dce.c: Update tree_pass descriptors. * tree-ssa.c: Update tree_pass descriptors. * regclass.c: Update tree_pass descriptors. * integrate.c: Update tree_pass descriptors. * tree-optimize.c: Update tree_pass descriptors. * tree-ssa-phiprop.c: Update tree_pass descriptors. * tree-object-size.c: Update tree_pass descriptors. * combine.c: Update tree_pass descriptors. * tree-outof-ssa.c: Update tree_pass descriptors. * bb-reorder.c: Update tree_pass descriptors. * stack-ptr-mod.c: Update tree_pass descriptors. * var-tracking.c: Update tree_pass descriptors. * tree-profile.c: Update tree_pass descriptors. * tree-vect-generic.c: Update tree_pass descriptors. * reg-stack.c: Update tree_pass descriptors. * sched-rgn.c: Update tree_pass descriptors. * tree-ssa-structalias.c: Update tree_pass descriptors. * tree-cfg.c: Update tree_pass descriptors. * passes.c (current_pass): Update declaration. (finish_optimization_passes): Update. (all_passes, all_ipa_passes, all_lowering_passes): Update declaration. (register_one_dump_file, register_dump_files_1, next_pass_1): Update arguments. (init_optimization_passes): Update handling of new types. (execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update. * ipa-struct-reorg.c: Update tree_pass descriptors. * tree-ssa-reassoc.c: Update tree_pass descriptors. * combine-stack-adj.c: Update tree_pass descriptors. * cfgrtl.c: Update tree_pass descriptors. * dce.c: Update tree_pass descriptors. * tree-ssanames.c: Update tree_pass descriptors. From-SVN: r133342
2008-03-19 12:22:40 +01:00
0 /* todo_flags_finish */
}
};
tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. 2008-01-29 Vladimir Makarov <vmakarov@redhat.com> * doc/tm.texi (TARGET_IRA_COVER_CLASSES): Modify description. * doc/passes.texi: Remove entries about regclass, local-alloc, and global. Modify entries about regmove and IRA. * ra-conflict.c: Remove the file. * reload.c (push_reload, find_dummy_reload): Remove flag_ira. * tree-pass.h (pass_local_alloc, pass_global_alloc): Remove. (pass_regclass_init): Rename to pass_reginfo_init. * cfgloopanal.c (estimate_reg_pressure_cost): Remove flag_ira. * toplev.h (flag_ira): Remove. * caller-save.c (setup_save_areas): Remove flag_ira. * ira-color.c (ira_reuse_stack_slot, ira_mark_new_stack_slot): Ditto. * global.c: Remove the file. * opts.c: (decode_options): Remove flag_ira. * hard-reg-set.h (losing_caller_save_reg_set): Remove. * regmove.c: Modify file description. (find_use_as_address, try_auto_increment): Define them only if AUTO_INC_DEC is defined. (replacement_quality, replace_in_call_usage, fixup_match_1, stable_and_no_regs_but_for_p): Remove. (reg_set_in_bb): Make it static. (regmove_optimize): Remove flag_ira and code which worked for !flag_ira. * local-alloc.c: Remove the file. * common.opt (fira): Remove. * ira.c: Include except.h. (eliminable_regset): Move from global.c. (mark_elimination): Ditto. Remove flag_ira. (reg_renumber, struct equivalence, reg_equiv, equiv_mem, equiv_mem_modified, validate_equiv_mem_from_store, validate_equiv_mem, equiv_init_varies_p, equiv_init_movable_p, contains_replace_regs, memref_referenced_p, memref_used_between_p, no_equiv, recorded_label_ref): Move from local-alloc.c. (update_equiv_regs): Ditto. Make it static. (print_insn_chain, print_insn_chains): Move it from global.c. pseudo_for_reload_consideration_p): Ditto. Remove flag_ira. (build_insn_chain): Ditto. Make it static. (ra_init_live_subregs): Move from ra-conflict.c. Make it static. Rename to init_live_subregs. (gate_ira): Remove flag_ira. * regclass.c: Rename reginfo.c. Change file description. (FORBIDDEN_INC_DEC_CLASSES): Remove. (reg_class_superclasses, forbidden_inc_dec_class, in_inc_dec): Remove. (init_reg_sets_1): Remove code for evaluation of reg_class_superclasses and losing_caller_save_reg_set. (init_regs): Remove init_reg_autoinc. (struct costs, costs, init_cost, ok_for_index_p_nonstrict, ok_for_base_p_nonstrict): Remove. (regclass_init): Rename to reginfo_init. Don't initialize init_cost. (pass_regclass_init): Rename to pass_reginfo_init. Modify corresponding entries. (dump_regclass, record_operand_costs, scan_one_insn, init_reg_autoinc, regclass, record_reg_classes, copy_cost, record_address_regs, auto_inc_dec_reg_p): Remove. (gt-regclass.h): Rename to gt-reginfo.h. * rtl.h (dump_global_regs, retry_global_alloc, build_insn_chain, dump_local_alloc, update_equiv_regs): Remove. * Makefile.in (RA_H): Remove. (OBJS-common): Remove global.o, local-alloc.o, and ra-conflict.o. Rename regclass.o to reginfo.o. (regclass.o): Rename to reginfo.o. Rename gt-regclass.h to gt-reginfo.h. (global.o, local-alloc.o, ra-conflict.o): Remove entries. (GTFILES): Rename regclass.c to reginfo.c. * passes.c (init_optimization_passes): Remove pass_local_alloc and pass_global_alloc. Rename pass_regclass_init to pass_reginfo_init. * reload1.c (compute_use_by_pseudos, reload, count_pseudo, count_spilled_pseudo, find_reg, alter_reg, delete_output_reload): Remove flag_ira. (finish_spills): Ditto. Remove code for !flga_ira. From-SVN: r143757
2009-01-29 15:51:46 +01:00
#include "gt-reginfo.h"