2000-04-05 02:32:45 +02:00
|
|
|
|
/* Register renaming for the GNU compiler.
|
2007-06-11 20:02:15 +02:00
|
|
|
|
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
|
2005-01-15 17:06:17 +01:00
|
|
|
|
Free Software Foundation, Inc.
|
2000-04-05 02:32:45 +02: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.
|
2000-04-05 02:32:45 +02: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
|
2000-04-05 02:32:45 +02:00
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
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.
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
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
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
2005-06-25 04:02:01 +02:00
|
|
|
|
Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
|
|
|
|
|
02110-1301, USA. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
2000-04-05 02:32:45 +02:00
|
|
|
|
#include "rtl.h"
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#include "tm_p.h"
|
2000-04-05 02:32:45 +02:00
|
|
|
|
#include "insn-config.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"
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#include "hard-reg-set.h"
|
|
|
|
|
#include "basic-block.h"
|
|
|
|
|
#include "reload.h"
|
2000-04-05 02:32:45 +02:00
|
|
|
|
#include "output.h"
|
|
|
|
|
#include "function.h"
|
|
|
|
|
#include "recog.h"
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#include "flags.h"
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
#include "toplev.h"
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#include "obstack.h"
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
#include "timevar.h"
|
|
|
|
|
#include "tree-pass.h"
|
2007-06-11 20:02:15 +02:00
|
|
|
|
#include "df.h"
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
|
|
|
|
struct du_chain
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
struct du_chain *next_chain;
|
|
|
|
|
struct du_chain *next_use;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
rtx insn;
|
|
|
|
|
rtx *loc;
|
2004-07-25 19:57:24 +02:00
|
|
|
|
ENUM_BITFIELD(reg_class) cl : 16;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
unsigned int need_caller_save_reg:1;
|
2000-12-22 16:44:42 +01:00
|
|
|
|
unsigned int earlyclobber:1;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
};
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
enum scan_actions
|
|
|
|
|
{
|
|
|
|
|
terminate_all_read,
|
|
|
|
|
terminate_overlapping_read,
|
|
|
|
|
terminate_write,
|
|
|
|
|
terminate_dead,
|
|
|
|
|
mark_read,
|
2005-11-16 01:22:15 +01:00
|
|
|
|
mark_write,
|
|
|
|
|
/* mark_access is for marking the destination regs in
|
|
|
|
|
REG_FRAME_RELATED_EXPR notes (as if they were read) so that the
|
|
|
|
|
note is updated properly. */
|
|
|
|
|
mark_access
|
2000-10-27 22:58:57 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const char * const scan_actions_name[] =
|
|
|
|
|
{
|
|
|
|
|
"terminate_all_read",
|
|
|
|
|
"terminate_overlapping_read",
|
|
|
|
|
"terminate_write",
|
|
|
|
|
"terminate_dead",
|
|
|
|
|
"mark_read",
|
2005-11-16 01:22:15 +01:00
|
|
|
|
"mark_write",
|
|
|
|
|
"mark_access"
|
2000-10-27 22:58:57 +02:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct obstack rename_obstack;
|
|
|
|
|
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static void do_replace (struct du_chain *, int);
|
|
|
|
|
static void scan_rtx_reg (rtx, rtx *, enum reg_class,
|
|
|
|
|
enum scan_actions, enum op_type, int);
|
|
|
|
|
static void scan_rtx_address (rtx, rtx *, enum reg_class,
|
|
|
|
|
enum scan_actions, enum machine_mode);
|
|
|
|
|
static void scan_rtx (rtx, rtx *, enum reg_class, enum scan_actions,
|
|
|
|
|
enum op_type, int);
|
|
|
|
|
static struct du_chain *build_def_use (basic_block);
|
|
|
|
|
static void dump_def_use_chain (struct du_chain *);
|
|
|
|
|
static void note_sets (rtx, rtx, void *);
|
|
|
|
|
static void clear_dead_regs (HARD_REG_SET *, enum machine_mode, rtx);
|
|
|
|
|
static void merge_overlapping_regs (basic_block, HARD_REG_SET *,
|
|
|
|
|
struct du_chain *);
|
2000-12-22 16:44:42 +01:00
|
|
|
|
|
2007-06-11 20:02:15 +02:00
|
|
|
|
/* Called through note_stores. Find sets of registers, and
|
2000-12-22 16:44:42 +01:00
|
|
|
|
record them in *DATA (which is actually a HARD_REG_SET *). */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
note_sets (rtx x, rtx set ATTRIBUTE_UNUSED, void *data)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
{
|
|
|
|
|
HARD_REG_SET *pset = (HARD_REG_SET *) data;
|
2005-01-24 13:31:22 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == SUBREG)
|
|
|
|
|
x = SUBREG_REG (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
|
|
|
|
if (!REG_P (x))
|
2000-12-22 16:44:42 +01:00
|
|
|
|
return;
|
2001-09-29 23:52:12 +02:00
|
|
|
|
/* There must not be pseudos at this point. */
|
2007-05-22 22:52:39 +02:00
|
|
|
|
gcc_assert (HARD_REGISTER_P (x));
|
|
|
|
|
add_to_hard_reg_set (pset, GET_MODE (x), REGNO (x));
|
2000-12-22 16:44:42 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Clear all registers from *PSET for which a note of kind KIND can be found
|
|
|
|
|
in the list NOTES. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
clear_dead_regs (HARD_REG_SET *pset, enum machine_mode kind, rtx notes)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
{
|
|
|
|
|
rtx note;
|
|
|
|
|
for (note = notes; note; note = XEXP (note, 1))
|
|
|
|
|
if (REG_NOTE_KIND (note) == kind && REG_P (XEXP (note, 0)))
|
|
|
|
|
{
|
|
|
|
|
rtx reg = XEXP (note, 0);
|
2001-09-29 23:52:12 +02:00
|
|
|
|
/* There must not be pseudos at this point. */
|
2007-05-22 22:52:39 +02:00
|
|
|
|
gcc_assert (HARD_REGISTER_P (reg));
|
|
|
|
|
remove_from_hard_reg_set (pset, GET_MODE (reg), REGNO (reg));
|
2000-12-22 16:44:42 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For a def-use chain CHAIN in basic block B, find which registers overlap
|
|
|
|
|
its lifetime and set the corresponding bits in *PSET. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
merge_overlapping_regs (basic_block b, HARD_REG_SET *pset,
|
|
|
|
|
struct du_chain *chain)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
{
|
|
|
|
|
struct du_chain *t = chain;
|
|
|
|
|
rtx insn;
|
|
|
|
|
HARD_REG_SET live;
|
|
|
|
|
|
df.h (DF_FIRST_OPTIONAL_PROBLEM): Removed.
2007-06-15 Kenneth Zadeck <zadeck@naturalbridge.com>
* df.h (DF_FIRST_OPTIONAL_PROBLEM): Removed.
(struct df_problem.free_blocks_on_set_blocks): New field.
(struct dataflow.optional_p): New field.
(df_bb_regno_last_use_find, df_insn_regno_def_p): Removed.
(df_live_set_all_dirty): New function.
* df-scan.c (df_scan_alloc): Initialize optional_p.
(problem_SCAN): Initialize free_blocks_on_set_blocks.
* df-core.c (df_set_blocks): Removed use of
DF_FIRST_OPTIONAL_PROBLEM. Now uses
df_problem.free_blocks_on_set_blocks to determine which blocks are
recycled.
(df_remove_problem): Removed use of DF_FIRST_OPTIONAL_PROBLEM.
(df_finish_pass): Removed use of DF_FIRST_OPTIONAL_PROBLEM. Now
uses dataflow.optional_p to determine if problem should be
deleted.
(rest_of_handle_df_initialize): Only start live problem if
-02 or above.
(df_bb_regno_last_use_find, df_insn_regno_def_p): Removed.
* df-problems.c (df_ru_alloc, df_rd_alloc, df_lr_alloc,
df_live_alloc, df_urec_alloc, df_note_alloc): set optional_p.
(problem_RU, problem_RD, problem_LR, problem_UREC, problem_CHAIN,
problem_NOTE): Initialize free_blocks_on_set_blocks.
(df_lr_bb_local_compute): Recompute luids if df_live problem is
not active.
(df_live_set_all_dirty, df_note_alloc): New function.
* regrename.c (merge_overlapping_regs): Change DF_LIVE_* to
df_get_live_*.
* sched_ebb.c (compute_jump_reg_dependencies): Ditto.
* postreload.c (reload_combine): Ditto.
* cse.c (cse_extended_basic_block): Ditto.
* regmove.c (mark_flags_life_zones): Ditto.
* rtlfactoring.c (split_blocks_after_seqs, split_pattern_seq,
erase_matching_seqs): Ditto.
* bt-load.c (compute_defs_uses_and_gen): Ditto.
* integrate (allocate_initial_values): Ditto.
* combine.c (reg_dead_at_p): Ditto.
* resource.c (mark_target_live_regs): Ditto.
* sched-rgn.c (check_live_1, update_live_1): Ditto.
* config/sh/sh.c (find_r0_life_regions): Ditto.
* global.c (rest_of_handle_global_alloc): Only add back df_live
for -O > 1.
* local-alloc.c (rest_of_handle_local_alloc): Only remove
df_live for -O > 1.
* ifcvt.c (dead_or_predicable): Change DF_LIVE_* to
df_get_live_*.
(if_convert): Make sure df_live is there at -O == 1.
(pass_if_after_combine): Cleanup flags.
* init-regs.c (initialize_uninitialized_regs): Make sure df_live
is there at -O == 1.
From-SVN: r125857
2007-06-19 21:04:52 +02:00
|
|
|
|
REG_SET_TO_HARD_REG_SET (live, df_get_live_in (b));
|
basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
fields of a basic block.
* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
final.c, flow.c, function.c, gcse.c, global.c, graph.c,
haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
accessing the `head' and `end' fields of a basic block directly.
* gengtype.c: Add missing piece from earlier patch. Dunno what
I was thinking...
From-SVN: r74520
2003-12-11 01:20:51 +01:00
|
|
|
|
insn = BB_HEAD (b);
|
2000-12-22 16:44:42 +01:00
|
|
|
|
while (t)
|
|
|
|
|
{
|
|
|
|
|
/* Search forward until the next reference to the register to be
|
|
|
|
|
renamed. */
|
|
|
|
|
while (insn != t->insn)
|
|
|
|
|
{
|
|
|
|
|
if (INSN_P (insn))
|
|
|
|
|
{
|
|
|
|
|
clear_dead_regs (&live, REG_DEAD, REG_NOTES (insn));
|
|
|
|
|
note_stores (PATTERN (insn), note_sets, (void *) &live);
|
|
|
|
|
/* Only record currently live regs if we are inside the
|
|
|
|
|
reg's live range. */
|
|
|
|
|
if (t != chain)
|
|
|
|
|
IOR_HARD_REG_SET (*pset, live);
|
2002-05-03 14:07:30 +02:00
|
|
|
|
clear_dead_regs (&live, REG_UNUSED, REG_NOTES (insn));
|
2000-12-22 16:44:42 +01:00
|
|
|
|
}
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
IOR_HARD_REG_SET (*pset, live);
|
|
|
|
|
|
|
|
|
|
/* For the last reference, also merge in all registers set in the
|
|
|
|
|
same insn.
|
|
|
|
|
@@@ We only have take earlyclobbered sets into account. */
|
|
|
|
|
if (! t->next_use)
|
|
|
|
|
note_stores (PATTERN (insn), note_sets, (void *) pset);
|
|
|
|
|
|
|
|
|
|
t = t->next_use;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Perform register renaming on the current function. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2006-01-18 16:05:35 +01:00
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
regrename_optimize (void)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
2000-12-22 16:44:42 +01:00
|
|
|
|
int tick[FIRST_PSEUDO_REGISTER];
|
|
|
|
|
int this_tick = 0;
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
basic_block bb;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
char *first_obj;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2007-06-11 20:02:15 +02:00
|
|
|
|
df_set_flags (DF_LR_RUN_DCE);
|
|
|
|
|
df_note_add_problem ();
|
|
|
|
|
df_analyze ();
|
|
|
|
|
df_set_flags (DF_NO_INSN_RESCAN);
|
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
memset (tick, 0, sizeof tick);
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
gcc_obstack_init (&rename_obstack);
|
2003-07-19 16:47:15 +02:00
|
|
|
|
first_obj = obstack_alloc (&rename_obstack, 0);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
FOR_EACH_BB (bb)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
|
|
|
|
struct du_chain *all_chains = 0;
|
|
|
|
|
HARD_REG_SET unavailable;
|
|
|
|
|
HARD_REG_SET regs_seen;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
CLEAR_HARD_REG_SET (unavailable);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, "\nBasic block %d:\n", bb->index);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
all_chains = build_def_use (bb);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
dump_def_use_chain (all_chains);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
CLEAR_HARD_REG_SET (unavailable);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Don't clobber traceback for noreturn functions. */
|
|
|
|
|
if (frame_pointer_needed)
|
|
|
|
|
{
|
2007-05-22 22:52:39 +02:00
|
|
|
|
add_to_hard_reg_set (&unavailable, Pmode, FRAME_POINTER_REGNUM);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
|
2007-05-22 22:52:39 +02:00
|
|
|
|
add_to_hard_reg_set (&unavailable, Pmode, HARD_FRAME_POINTER_REGNUM);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#endif
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
CLEAR_HARD_REG_SET (regs_seen);
|
|
|
|
|
while (all_chains)
|
|
|
|
|
{
|
2003-10-12 00:57:48 +02:00
|
|
|
|
int new_reg, best_new_reg;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
int n_uses;
|
|
|
|
|
struct du_chain *this = all_chains;
|
|
|
|
|
struct du_chain *tmp, *last;
|
|
|
|
|
HARD_REG_SET this_unavailable;
|
2001-07-22 09:10:46 +02:00
|
|
|
|
int reg = REGNO (*this->loc);
|
2000-10-28 23:41:24 +02:00
|
|
|
|
int i;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
all_chains = this->next_chain;
|
2002-05-03 14:07:30 +02:00
|
|
|
|
|
2003-10-12 00:57:48 +02:00
|
|
|
|
best_new_reg = reg;
|
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
#if 0 /* This just disables optimization opportunities. */
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Only rename once we've seen the reg more than once. */
|
|
|
|
|
if (! TEST_HARD_REG_BIT (regs_seen, reg))
|
2000-04-10 13:23:17 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
SET_HARD_REG_BIT (regs_seen, reg);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
2000-12-22 16:44:42 +01:00
|
|
|
|
#endif
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2001-01-04 15:17:40 +01:00
|
|
|
|
if (fixed_regs[reg] || global_regs[reg]
|
|
|
|
|
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
|
|
|
|
|
|| (frame_pointer_needed && reg == HARD_FRAME_POINTER_REGNUM)
|
|
|
|
|
#else
|
|
|
|
|
|| (frame_pointer_needed && reg == FRAME_POINTER_REGNUM)
|
|
|
|
|
#endif
|
|
|
|
|
)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
continue;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
COPY_HARD_REG_SET (this_unavailable, unavailable);
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Find last entry on chain (which has the need_caller_save bit),
|
|
|
|
|
count number of uses, and narrow the set of registers we can
|
|
|
|
|
use for renaming. */
|
|
|
|
|
n_uses = 0;
|
|
|
|
|
for (last = this; last->next_use; last = last->next_use)
|
|
|
|
|
{
|
|
|
|
|
n_uses++;
|
|
|
|
|
IOR_COMPL_HARD_REG_SET (this_unavailable,
|
2004-07-25 19:57:24 +02:00
|
|
|
|
reg_class_contents[last->cl]);
|
2000-04-10 13:23:17 +02:00
|
|
|
|
}
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (n_uses < 1)
|
|
|
|
|
continue;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
IOR_COMPL_HARD_REG_SET (this_unavailable,
|
2004-07-25 19:57:24 +02:00
|
|
|
|
reg_class_contents[last->cl]);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
if (this->need_caller_save_reg)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
IOR_HARD_REG_SET (this_unavailable, call_used_reg_set);
|
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
merge_overlapping_regs (bb, &this_unavailable, this);
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Now potential_regs is a reasonable approximation, let's
|
|
|
|
|
have a closer look at each register still in there. */
|
2001-07-22 09:10:46 +02:00
|
|
|
|
for (new_reg = 0; new_reg < FIRST_PSEUDO_REGISTER; new_reg++)
|
2000-04-10 13:23:17 +02:00
|
|
|
|
{
|
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 nregs = hard_regno_nregs[new_reg][GET_MODE (*this->loc)];
|
2001-07-22 09:10:46 +02:00
|
|
|
|
|
2000-10-28 23:41:24 +02:00
|
|
|
|
for (i = nregs - 1; i >= 0; --i)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
if (TEST_HARD_REG_BIT (this_unavailable, new_reg + i)
|
|
|
|
|
|| fixed_regs[new_reg + i]
|
|
|
|
|
|| global_regs[new_reg + i]
|
2000-10-28 23:41:24 +02:00
|
|
|
|
/* Can't use regs which aren't saved by the prologue. */
|
2007-06-11 20:02:15 +02:00
|
|
|
|
|| (! df_regs_ever_live_p (new_reg + i)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
&& ! call_used_regs[new_reg + i])
|
2001-05-14 09:56:57 +02:00
|
|
|
|
#ifdef LEAF_REGISTERS
|
2002-05-03 14:07:30 +02:00
|
|
|
|
/* We can't use a non-leaf register if we're in a
|
2001-05-14 09:56:57 +02:00
|
|
|
|
leaf function. */
|
2002-05-03 14:07:30 +02:00
|
|
|
|
|| (current_function_is_leaf
|
2001-05-14 09:56:57 +02:00
|
|
|
|
&& !LEAF_REGISTERS[new_reg + i])
|
|
|
|
|
#endif
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#ifdef HARD_REGNO_RENAME_OK
|
2000-12-22 16:44:42 +01:00
|
|
|
|
|| ! HARD_REGNO_RENAME_OK (reg + i, new_reg + i)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#endif
|
2000-10-28 23:41:24 +02:00
|
|
|
|
)
|
|
|
|
|
break;
|
|
|
|
|
if (i >= 0)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
continue;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-28 23:41:24 +02:00
|
|
|
|
/* See whether it accepts all modes that occur in
|
|
|
|
|
definition and uses. */
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (tmp = this; tmp; tmp = tmp->next_use)
|
2002-02-11 14:35:14 +01:00
|
|
|
|
if (! HARD_REGNO_MODE_OK (new_reg, GET_MODE (*tmp->loc))
|
|
|
|
|
|| (tmp->need_caller_save_reg
|
|
|
|
|
&& ! (HARD_REGNO_CALL_PART_CLOBBERED
|
|
|
|
|
(reg, GET_MODE (*tmp->loc)))
|
|
|
|
|
&& (HARD_REGNO_CALL_PART_CLOBBERED
|
|
|
|
|
(new_reg, GET_MODE (*tmp->loc)))))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
break;
|
|
|
|
|
if (! tmp)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
{
|
2003-10-12 00:57:48 +02:00
|
|
|
|
if (tick[best_new_reg] > tick[new_reg])
|
2000-12-22 16:44:42 +01:00
|
|
|
|
best_new_reg = new_reg;
|
|
|
|
|
}
|
2000-04-10 13:23:17 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
fprintf (dump_file, "Register %s in insn %d",
|
2000-10-27 22:58:57 +02:00
|
|
|
|
reg_names[reg], INSN_UID (last->insn));
|
|
|
|
|
if (last->need_caller_save_reg)
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
fprintf (dump_file, " crosses a call");
|
2002-05-03 14:07:30 +02:00
|
|
|
|
}
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2003-10-12 00:57:48 +02:00
|
|
|
|
if (best_new_reg == reg)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
2003-10-12 00:57:48 +02:00
|
|
|
|
tick[reg] = ++this_tick;
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, "; no available better choice\n");
|
2000-04-05 02:32:45 +02:00
|
|
|
|
continue;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
do_replace (this, best_new_reg);
|
2003-10-12 00:57:48 +02:00
|
|
|
|
tick[best_new_reg] = ++this_tick;
|
2007-06-11 20:02:15 +02:00
|
|
|
|
df_set_regs_ever_live (best_new_reg, true);
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, ", renamed as %s\n", reg_names[best_new_reg]);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
obstack_free (&rename_obstack, first_obj);
|
|
|
|
|
}
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
obstack_free (&rename_obstack, NULL);
|
2007-06-11 20:02:15 +02:00
|
|
|
|
df_clear_flags (DF_NO_INSN_RESCAN);
|
|
|
|
|
df_insn_rescan_all ();
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fputc ('\n', dump_file);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
do_replace (struct du_chain *chain, int reg)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
while (chain)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-12-29 18:35:57 +01:00
|
|
|
|
unsigned int regno = ORIGINAL_REGNO (*chain->loc);
|
2003-02-07 02:20:04 +01:00
|
|
|
|
struct reg_attrs * attr = REG_ATTRS (*chain->loc);
|
|
|
|
|
|
2000-12-29 18:35:57 +01:00
|
|
|
|
*chain->loc = gen_raw_REG (GET_MODE (*chain->loc), reg);
|
2001-01-04 15:17:40 +01:00
|
|
|
|
if (regno >= FIRST_PSEUDO_REGISTER)
|
|
|
|
|
ORIGINAL_REGNO (*chain->loc) = regno;
|
2003-02-07 02:20:04 +01:00
|
|
|
|
REG_ATTRS (*chain->loc) = attr;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
chain = chain->next_use;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
static struct du_chain *open_chains;
|
|
|
|
|
static struct du_chain *closed_chains;
|
|
|
|
|
|
|
|
|
|
static void
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_reg (rtx insn, rtx *loc, enum reg_class cl,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
enum scan_actions action, enum op_type type, int earlyclobber)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
struct du_chain **p;
|
|
|
|
|
rtx x = *loc;
|
|
|
|
|
enum machine_mode mode = GET_MODE (x);
|
|
|
|
|
int this_regno = REGNO (x);
|
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 this_nregs = hard_regno_nregs[this_regno][mode];
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
|
|
|
|
if (action == mark_write)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (type == OP_OUT)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2003-07-19 16:47:15 +02:00
|
|
|
|
struct du_chain *this
|
|
|
|
|
= obstack_alloc (&rename_obstack, sizeof (struct du_chain));
|
2000-10-27 22:58:57 +02:00
|
|
|
|
this->next_use = 0;
|
|
|
|
|
this->next_chain = open_chains;
|
|
|
|
|
this->loc = loc;
|
|
|
|
|
this->insn = insn;
|
2004-07-25 19:57:24 +02:00
|
|
|
|
this->cl = cl;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
this->need_caller_save_reg = 0;
|
2000-12-22 16:44:42 +01:00
|
|
|
|
this->earlyclobber = earlyclobber;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
open_chains = this;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2005-11-16 01:22:15 +01:00
|
|
|
|
if ((type == OP_OUT) != (action == terminate_write || action == mark_access))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-05-11 15:52:44 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (p = &open_chains; *p;)
|
2000-05-11 15:52:44 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
struct du_chain *this = *p;
|
|
|
|
|
|
2000-11-15 12:07:44 +01:00
|
|
|
|
/* Check if the chain has been terminated if it has then skip to
|
|
|
|
|
the next chain.
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
2000-11-15 12:07:44 +01:00
|
|
|
|
This can happen when we've already appended the location to
|
|
|
|
|
the chain in Step 3, but are trying to hide in-out operands
|
|
|
|
|
from terminate_write in Step 5. */
|
2000-05-11 15:52:44 +02:00
|
|
|
|
|
2000-11-15 12:07:44 +01:00
|
|
|
|
if (*this->loc == cc0_rtx)
|
|
|
|
|
p = &this->next_chain;
|
|
|
|
|
else
|
2002-05-03 14:07:30 +02:00
|
|
|
|
{
|
2000-11-15 12:07:44 +01:00
|
|
|
|
int regno = REGNO (*this->loc);
|
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 nregs = hard_regno_nregs[regno][GET_MODE (*this->loc)];
|
2000-11-15 12:07:44 +01:00
|
|
|
|
int exact_match = (regno == this_regno && nregs == this_nregs);
|
|
|
|
|
|
|
|
|
|
if (regno + nregs <= this_regno
|
|
|
|
|
|| this_regno + this_nregs <= regno)
|
2000-11-22 04:19:34 +01:00
|
|
|
|
{
|
|
|
|
|
p = &this->next_chain;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-16 01:22:15 +01:00
|
|
|
|
if (action == mark_read || action == mark_access)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
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 (exact_match);
|
2000-11-15 12:07:44 +01:00
|
|
|
|
|
2002-05-03 14:07:30 +02:00
|
|
|
|
/* ??? Class NO_REGS can happen if the md file makes use of
|
2000-11-22 04:19:34 +01:00
|
|
|
|
EXTRA_CONSTRAINTS to match registers. Which is arguably
|
|
|
|
|
wrong, but there we are. Since we know not what this may
|
|
|
|
|
be replaced with, terminate the chain. */
|
2004-07-25 19:57:24 +02:00
|
|
|
|
if (cl != NO_REGS)
|
2000-11-22 04:19:34 +01:00
|
|
|
|
{
|
2003-07-19 16:47:15 +02:00
|
|
|
|
this = obstack_alloc (&rename_obstack, sizeof (struct du_chain));
|
2000-12-22 16:44:42 +01:00
|
|
|
|
this->next_use = 0;
|
2000-11-22 04:19:34 +01:00
|
|
|
|
this->next_chain = (*p)->next_chain;
|
|
|
|
|
this->loc = loc;
|
|
|
|
|
this->insn = insn;
|
2004-07-25 19:57:24 +02:00
|
|
|
|
this->cl = cl;
|
2000-11-22 04:19:34 +01:00
|
|
|
|
this->need_caller_save_reg = 0;
|
2000-12-22 16:44:42 +01:00
|
|
|
|
while (*p)
|
|
|
|
|
p = &(*p)->next_use;
|
2000-11-22 04:19:34 +01:00
|
|
|
|
*p = this;
|
|
|
|
|
return;
|
|
|
|
|
}
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-11-22 04:19:34 +01:00
|
|
|
|
|
|
|
|
|
if (action != terminate_overlapping_read || ! exact_match)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
2000-11-15 12:07:44 +01:00
|
|
|
|
struct du_chain *next = this->next_chain;
|
|
|
|
|
|
|
|
|
|
/* Whether the terminated chain can be used for renaming
|
|
|
|
|
depends on the action and this being an exact match.
|
|
|
|
|
In either case, we remove this element from open_chains. */
|
|
|
|
|
|
|
|
|
|
if ((action == terminate_dead || action == terminate_write)
|
|
|
|
|
&& exact_match)
|
|
|
|
|
{
|
|
|
|
|
this->next_chain = closed_chains;
|
|
|
|
|
closed_chains = this;
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file,
|
2000-11-15 12:07:44 +01:00
|
|
|
|
"Closing chain %s at insn %d (%s)\n",
|
|
|
|
|
reg_names[REGNO (*this->loc)], INSN_UID (insn),
|
|
|
|
|
scan_actions_name[(int) action]);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file,
|
2000-11-15 12:07:44 +01:00
|
|
|
|
"Discarding chain %s at insn %d (%s)\n",
|
|
|
|
|
reg_names[REGNO (*this->loc)], INSN_UID (insn),
|
|
|
|
|
scan_actions_name[(int) action]);
|
|
|
|
|
}
|
|
|
|
|
*p = next;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-11-15 12:07:44 +01:00
|
|
|
|
else
|
|
|
|
|
p = &this->next_chain;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2004-07-25 19:57:24 +02:00
|
|
|
|
/* Adapted from find_reloads_address_1. CL is INDEX_REG_CLASS or
|
2000-10-27 22:58:57 +02:00
|
|
|
|
BASE_REG_CLASS depending on how the register is being considered. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-20 19:54:49 +02:00
|
|
|
|
static void
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_address (rtx insn, rtx *loc, enum reg_class cl,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
enum scan_actions action, enum machine_mode mode)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
rtx x = *loc;
|
|
|
|
|
RTX_CODE code = GET_CODE (x);
|
|
|
|
|
const char *fmt;
|
|
|
|
|
int i, j;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2005-11-16 01:22:15 +01:00
|
|
|
|
if (action == mark_write || action == mark_access)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
switch (code)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case PLUS:
|
|
|
|
|
{
|
|
|
|
|
rtx orig_op0 = XEXP (x, 0);
|
|
|
|
|
rtx orig_op1 = XEXP (x, 1);
|
|
|
|
|
RTX_CODE code0 = GET_CODE (orig_op0);
|
|
|
|
|
RTX_CODE code1 = GET_CODE (orig_op1);
|
|
|
|
|
rtx op0 = orig_op0;
|
|
|
|
|
rtx op1 = orig_op1;
|
|
|
|
|
rtx *locI = NULL;
|
|
|
|
|
rtx *locB = NULL;
|
2006-03-24 16:53:23 +01:00
|
|
|
|
enum rtx_code index_code = SCRATCH;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (op0) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
op0 = SUBREG_REG (op0);
|
|
|
|
|
code0 = GET_CODE (op0);
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (GET_CODE (op1) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
op1 = SUBREG_REG (op1);
|
|
|
|
|
code1 = GET_CODE (op1);
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (code0 == MULT || code0 == SIGN_EXTEND || code0 == TRUNCATE
|
|
|
|
|
|| code0 == ZERO_EXTEND || code1 == MEM)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 0);
|
|
|
|
|
locB = &XEXP (x, 1);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
|
|
|
|
else if (code1 == MULT || code1 == SIGN_EXTEND || code1 == TRUNCATE
|
|
|
|
|
|| code1 == ZERO_EXTEND || code0 == MEM)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 1);
|
|
|
|
|
locB = &XEXP (x, 0);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
|
|
|
|
else if (code0 == CONST_INT || code0 == CONST
|
|
|
|
|
|| code0 == SYMBOL_REF || code0 == LABEL_REF)
|
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
|
|
|
|
{
|
|
|
|
|
locB = &XEXP (x, 1);
|
|
|
|
|
index_code = GET_CODE (XEXP (x, 0));
|
|
|
|
|
}
|
2000-10-27 22:58:57 +02:00
|
|
|
|
else if (code1 == CONST_INT || code1 == CONST
|
|
|
|
|
|| code1 == SYMBOL_REF || code1 == LABEL_REF)
|
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
|
|
|
|
{
|
|
|
|
|
locB = &XEXP (x, 0);
|
|
|
|
|
index_code = GET_CODE (XEXP (x, 1));
|
|
|
|
|
}
|
2000-10-27 22:58:57 +02:00
|
|
|
|
else if (code0 == REG && code1 == REG)
|
|
|
|
|
{
|
|
|
|
|
int index_op;
|
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
|
|
|
|
unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
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
|
|
|
|
if (REGNO_OK_FOR_INDEX_P (regno0)
|
|
|
|
|
&& regno_ok_for_base_p (regno1, mode, PLUS, REG))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
index_op = 0;
|
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
|
|
|
|
else if (REGNO_OK_FOR_INDEX_P (regno1)
|
|
|
|
|
&& regno_ok_for_base_p (regno0, mode, PLUS, REG))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
index_op = 1;
|
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
|
|
|
|
else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
index_op = 0;
|
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
|
|
|
|
else if (regno_ok_for_base_p (regno0, mode, PLUS, REG))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
index_op = 1;
|
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
|
|
|
|
else if (REGNO_OK_FOR_INDEX_P (regno1))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
index_op = 1;
|
|
|
|
|
else
|
|
|
|
|
index_op = 0;
|
|
|
|
|
|
|
|
|
|
locI = &XEXP (x, index_op);
|
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
|
|
|
|
locB = &XEXP (x, !index_op);
|
|
|
|
|
index_code = GET_CODE (*locI);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
|
|
|
|
else if (code0 == REG)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 0);
|
|
|
|
|
locB = &XEXP (x, 1);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
|
|
|
|
else if (code1 == REG)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 1);
|
|
|
|
|
locB = &XEXP (x, 0);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (locI)
|
2000-10-28 23:41:24 +02:00
|
|
|
|
scan_rtx_address (insn, locI, INDEX_REG_CLASS, action, mode);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (locB)
|
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
|
|
|
|
scan_rtx_address (insn, locB, base_reg_class (mode, PLUS, index_code),
|
2004-10-12 21:28:56 +02:00
|
|
|
|
action, mode);
|
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
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case POST_INC:
|
|
|
|
|
case POST_DEC:
|
|
|
|
|
case POST_MODIFY:
|
|
|
|
|
case PRE_INC:
|
|
|
|
|
case PRE_DEC:
|
|
|
|
|
case PRE_MODIFY:
|
|
|
|
|
#ifndef AUTO_INC_DEC
|
2000-10-29 06:41:44 +01:00
|
|
|
|
/* If the target doesn't claim to handle autoinc, this must be
|
|
|
|
|
something special, like a stack push. Kill this chain. */
|
|
|
|
|
action = terminate_all_read;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
#endif
|
|
|
|
|
break;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case MEM:
|
2001-12-17 17:46:11 +01:00
|
|
|
|
scan_rtx_address (insn, &XEXP (x, 0),
|
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
|
|
|
|
base_reg_class (GET_MODE (x), MEM, SCRATCH), action,
|
2000-10-28 23:41:24 +02:00
|
|
|
|
GET_MODE (x));
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case REG:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_reg (insn, loc, cl, action, OP_IN, 0);
|
2000-10-20 19:54:49 +02:00
|
|
|
|
return;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
default:
|
|
|
|
|
break;
|
2000-10-20 19:54:49 +02:00
|
|
|
|
}
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
2000-10-20 19:54:49 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (fmt[i] == 'e')
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_address (insn, &XEXP (x, i), cl, action, mode);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
else if (fmt[i] == 'E')
|
|
|
|
|
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_address (insn, &XVECEXP (x, i, j), cl, action, mode);
|
2000-10-20 19:54:49 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
static void
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (rtx insn, rtx *loc, enum reg_class cl,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
enum scan_actions action, enum op_type type, int earlyclobber)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
const char *fmt;
|
|
|
|
|
rtx x = *loc;
|
|
|
|
|
enum rtx_code code = GET_CODE (x);
|
|
|
|
|
int i, j;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
switch (code)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case CONST:
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
case CONST_DOUBLE:
|
2002-02-19 03:53:41 +01:00
|
|
|
|
case CONST_VECTOR:
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case SYMBOL_REF:
|
|
|
|
|
case LABEL_REF:
|
|
|
|
|
case CC0:
|
|
|
|
|
case PC:
|
|
|
|
|
return;
|
2000-04-05 03:23:57 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case REG:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_reg (insn, loc, cl, action, type, earlyclobber);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case MEM:
|
2001-12-17 17:46:11 +01:00
|
|
|
|
scan_rtx_address (insn, &XEXP (x, 0),
|
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
|
|
|
|
base_reg_class (GET_MODE (x), MEM, SCRATCH), action,
|
2000-10-28 23:41:24 +02:00
|
|
|
|
GET_MODE (x));
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case SET:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &SET_SRC (x), cl, action, OP_IN, 0);
|
2004-11-04 15:08:16 +01:00
|
|
|
|
scan_rtx (insn, &SET_DEST (x), cl, action,
|
|
|
|
|
GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case STRICT_LOW_PART:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XEXP (x, 0), cl, action, OP_INOUT, earlyclobber);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case ZERO_EXTRACT:
|
2002-05-03 14:07:30 +02:00
|
|
|
|
case SIGN_EXTRACT:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XEXP (x, 0), cl, action,
|
2000-12-22 16:44:42 +01:00
|
|
|
|
type == OP_IN ? OP_IN : OP_INOUT, earlyclobber);
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XEXP (x, 1), cl, action, OP_IN, 0);
|
|
|
|
|
scan_rtx (insn, &XEXP (x, 2), cl, action, OP_IN, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case POST_INC:
|
|
|
|
|
case PRE_INC:
|
|
|
|
|
case POST_DEC:
|
|
|
|
|
case PRE_DEC:
|
|
|
|
|
case POST_MODIFY:
|
|
|
|
|
case PRE_MODIFY:
|
|
|
|
|
/* Should only happen inside MEM. */
|
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_unreachable ();
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
|
|
|
|
case CLOBBER:
|
2004-11-04 15:08:16 +01:00
|
|
|
|
scan_rtx (insn, &SET_DEST (x), cl, action,
|
|
|
|
|
GET_CODE (PATTERN (insn)) == COND_EXEC ? OP_INOUT : OP_OUT, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
case EXPR_LIST:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XEXP (x, 0), cl, action, type, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (XEXP (x, 1))
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XEXP (x, 1), cl, action, type, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
return;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
|
|
|
|
if (fmt[i] == 'e')
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XEXP (x, i), cl, action, type, 0);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
else if (fmt[i] == 'E')
|
|
|
|
|
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, &XVECEXP (x, i, j), cl, action, type, 0);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-27 15:47:55 +01:00
|
|
|
|
/* Build def/use chain. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
static struct du_chain *
|
2003-07-06 11:56:09 +02:00
|
|
|
|
build_def_use (basic_block bb)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
rtx insn;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
open_chains = closed_chains = NULL;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
fields of a basic block.
* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
final.c, flow.c, function.c, gcse.c, global.c, graph.c,
haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
accessing the `head' and `end' fields of a basic block directly.
* gengtype.c: Add missing piece from earlier patch. Dunno what
I was thinking...
From-SVN: r74520
2003-12-11 01:20:51 +01:00
|
|
|
|
for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
|
|
|
|
if (INSN_P (insn))
|
|
|
|
|
{
|
|
|
|
|
int n_ops;
|
|
|
|
|
rtx note;
|
|
|
|
|
rtx old_operands[MAX_RECOG_OPERANDS];
|
|
|
|
|
rtx old_dups[MAX_DUP_OPERANDS];
|
2002-03-25 08:45:30 +01:00
|
|
|
|
int i, icode;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
int alt;
|
|
|
|
|
int predicated;
|
|
|
|
|
|
|
|
|
|
/* Process the insn, determining its effect on the def-use
|
|
|
|
|
chains. We perform the following steps with the register
|
|
|
|
|
references in the insn:
|
|
|
|
|
(1) Any read that overlaps an open chain, but doesn't exactly
|
|
|
|
|
match, causes that chain to be closed. We can't deal
|
|
|
|
|
with overlaps yet.
|
|
|
|
|
(2) Any read outside an operand causes any chain it overlaps
|
|
|
|
|
with to be closed, since we can't replace it.
|
|
|
|
|
(3) Any read inside an operand is added if there's already
|
|
|
|
|
an open chain for it.
|
|
|
|
|
(4) For any REG_DEAD note we find, close open chains that
|
|
|
|
|
overlap it.
|
|
|
|
|
(5) For any write we find, close open chains that overlap it.
|
|
|
|
|
(6) For any write we find in an operand, make a new chain.
|
|
|
|
|
(7) For any REG_UNUSED, close any chains we just opened. */
|
|
|
|
|
|
2002-03-25 13:51:49 +01:00
|
|
|
|
icode = recog_memoized (insn);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
extract_insn (insn);
|
2002-04-30 23:39:46 +02:00
|
|
|
|
if (! constrain_operands (1))
|
2002-05-03 14:07:30 +02:00
|
|
|
|
fatal_insn_not_found (insn);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
preprocess_constraints ();
|
|
|
|
|
alt = which_alternative;
|
|
|
|
|
n_ops = recog_data.n_operands;
|
|
|
|
|
|
|
|
|
|
/* Simplify the code below by rewriting things to reflect
|
|
|
|
|
matching constraints. Also promote OP_OUT to OP_INOUT
|
|
|
|
|
in predicated instructions. */
|
|
|
|
|
|
|
|
|
|
predicated = GET_CODE (PATTERN (insn)) == COND_EXEC;
|
|
|
|
|
for (i = 0; i < n_ops; ++i)
|
2000-04-05 02:32:45 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
int matches = recog_op_alt[i][alt].matches;
|
|
|
|
|
if (matches >= 0)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
recog_op_alt[i][alt].cl = recog_op_alt[matches][alt].cl;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (matches >= 0 || recog_op_alt[i][alt].matched >= 0
|
|
|
|
|
|| (predicated && recog_data.operand_type[i] == OP_OUT))
|
|
|
|
|
recog_data.operand_type[i] = OP_INOUT;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 1: Close chains for which we have overlapping reads. */
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
scan_rtx (insn, recog_data.operand_loc[i],
|
|
|
|
|
NO_REGS, terminate_overlapping_read,
|
2000-12-22 16:44:42 +01:00
|
|
|
|
recog_data.operand_type[i], 0);
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 2: Close chains for which we have reads outside operands.
|
2002-05-03 14:07:30 +02:00
|
|
|
|
We do this by munging all operands into CC0, and closing
|
2000-10-27 22:58:57 +02:00
|
|
|
|
everything remaining. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (i = 0; i < n_ops; i++)
|
2000-04-10 13:23:17 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
old_operands[i] = recog_data.operand[i];
|
|
|
|
|
/* Don't squash match_operator or match_parallel here, since
|
2002-05-03 14:07:30 +02:00
|
|
|
|
we don't know that all of the contained registers are
|
2000-10-27 22:58:57 +02:00
|
|
|
|
reachable by proper operands. */
|
|
|
|
|
if (recog_data.constraints[i][0] == '\0')
|
|
|
|
|
continue;
|
|
|
|
|
*recog_data.operand_loc[i] = cc0_rtx;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < recog_data.n_dups; i++)
|
|
|
|
|
{
|
2002-03-25 08:45:30 +01:00
|
|
|
|
int dup_num = recog_data.dup_num[i];
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
old_dups[i] = *recog_data.dup_loc[i];
|
|
|
|
|
*recog_data.dup_loc[i] = cc0_rtx;
|
2002-03-25 08:45:30 +01:00
|
|
|
|
|
|
|
|
|
/* For match_dup of match_operator or match_parallel, share
|
|
|
|
|
them, so that we don't miss changes in the dup. */
|
|
|
|
|
if (icode >= 0
|
|
|
|
|
&& insn_data[icode].operand[dup_num].eliminable == 0)
|
|
|
|
|
old_dups[i] = recog_data.operand[dup_num];
|
2000-04-10 13:23:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
scan_rtx (insn, &PATTERN (insn), NO_REGS, terminate_all_read,
|
|
|
|
|
OP_IN, 0);
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (i = 0; i < recog_data.n_dups; i++)
|
|
|
|
|
*recog_data.dup_loc[i] = old_dups[i];
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
*recog_data.operand_loc[i] = old_operands[i];
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 2B: Can't rename function call argument registers. */
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (CALL_P (insn) && CALL_INSN_FUNCTION_USAGE (insn))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
scan_rtx (insn, &CALL_INSN_FUNCTION_USAGE (insn),
|
2000-12-22 16:44:42 +01:00
|
|
|
|
NO_REGS, terminate_all_read, OP_IN, 0);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2002-01-01 00:16:08 +01:00
|
|
|
|
/* Step 2C: Can't rename asm operands that were originally
|
|
|
|
|
hard registers. */
|
|
|
|
|
if (asm_noperands (PATTERN (insn)) > 0)
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
{
|
|
|
|
|
rtx *loc = recog_data.operand_loc[i];
|
|
|
|
|
rtx op = *loc;
|
|
|
|
|
|
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 (op)
|
2002-01-01 00:16:08 +01:00
|
|
|
|
&& REGNO (op) == ORIGINAL_REGNO (op)
|
|
|
|
|
&& (recog_data.operand_type[i] == OP_IN
|
|
|
|
|
|| recog_data.operand_type[i] == OP_INOUT))
|
|
|
|
|
scan_rtx (insn, loc, NO_REGS, terminate_all_read, OP_IN, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 3: Append to chains for reads inside operands. */
|
|
|
|
|
for (i = 0; i < n_ops + recog_data.n_dups; i++)
|
|
|
|
|
{
|
|
|
|
|
int opn = i < n_ops ? i : recog_data.dup_num[i - n_ops];
|
|
|
|
|
rtx *loc = (i < n_ops
|
|
|
|
|
? recog_data.operand_loc[opn]
|
|
|
|
|
: recog_data.dup_loc[i - n_ops]);
|
2004-07-25 19:57:24 +02:00
|
|
|
|
enum reg_class cl = recog_op_alt[opn][alt].cl;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
enum op_type type = recog_data.operand_type[opn];
|
|
|
|
|
|
|
|
|
|
/* Don't scan match_operand here, since we've no reg class
|
|
|
|
|
information to pass down. Any operands that we could
|
|
|
|
|
substitute in will be represented elsewhere. */
|
|
|
|
|
if (recog_data.constraints[opn][0] == '\0')
|
|
|
|
|
continue;
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
if (recog_op_alt[opn][alt].is_address)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx_address (insn, loc, cl, mark_read, VOIDmode);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
else
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, loc, cl, mark_read, type, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2005-11-16 01:22:15 +01:00
|
|
|
|
/* Step 3B: Record updates for regs in REG_INC notes, and
|
|
|
|
|
source regs in REG_FRAME_RELATED_EXPR notes. */
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
|
2005-11-16 01:22:15 +01:00
|
|
|
|
if (REG_NOTE_KIND (note) == REG_INC
|
|
|
|
|
|| REG_NOTE_KIND (note) == REG_FRAME_RELATED_EXPR)
|
|
|
|
|
scan_rtx (insn, &XEXP (note, 0), ALL_REGS, mark_read,
|
|
|
|
|
OP_INOUT, 0);
|
|
|
|
|
|
|
|
|
|
/* Step 4: Close chains for registers that die here. */
|
|
|
|
|
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
|
|
|
|
|
if (REG_NOTE_KIND (note) == REG_DEAD)
|
|
|
|
|
scan_rtx (insn, &XEXP (note, 0), NO_REGS, terminate_dead,
|
|
|
|
|
OP_IN, 0);
|
2000-04-10 13:23:17 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 4B: If this is a call, any chain live at this point
|
|
|
|
|
requires a caller-saved reg. */
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (CALL_P (insn))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
|
|
|
|
struct du_chain *p;
|
|
|
|
|
for (p = open_chains; p; p = p->next_chain)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
p->need_caller_save_reg = 1;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 5: Close open chains that overlap writes. Similar to
|
|
|
|
|
step 2, we hide in-out operands, since we do not want to
|
|
|
|
|
close these chains. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
{
|
|
|
|
|
old_operands[i] = recog_data.operand[i];
|
|
|
|
|
if (recog_data.operand_type[i] == OP_INOUT)
|
|
|
|
|
*recog_data.operand_loc[i] = cc0_rtx;
|
|
|
|
|
}
|
|
|
|
|
for (i = 0; i < recog_data.n_dups; i++)
|
|
|
|
|
{
|
|
|
|
|
int opn = recog_data.dup_num[i];
|
|
|
|
|
old_dups[i] = *recog_data.dup_loc[i];
|
|
|
|
|
if (recog_data.operand_type[opn] == OP_INOUT)
|
|
|
|
|
*recog_data.dup_loc[i] = cc0_rtx;
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-12-22 16:44:42 +01:00
|
|
|
|
scan_rtx (insn, &PATTERN (insn), NO_REGS, terminate_write, OP_IN, 0);
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (i = 0; i < recog_data.n_dups; i++)
|
|
|
|
|
*recog_data.dup_loc[i] = old_dups[i];
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
*recog_data.operand_loc[i] = old_operands[i];
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 6: Begin new chains for writes inside operands. */
|
|
|
|
|
/* ??? Many targets have output constraints on the SET_DEST
|
|
|
|
|
of a call insn, which is stupid, since these are certainly
|
2002-01-01 00:16:08 +01:00
|
|
|
|
ABI defined hard registers. Don't change calls at all.
|
|
|
|
|
Similarly take special care for asm statement that originally
|
|
|
|
|
referenced hard registers. */
|
|
|
|
|
if (asm_noperands (PATTERN (insn)) > 0)
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
if (recog_data.operand_type[i] == OP_OUT)
|
|
|
|
|
{
|
|
|
|
|
rtx *loc = recog_data.operand_loc[i];
|
|
|
|
|
rtx op = *loc;
|
2004-07-25 19:57:24 +02:00
|
|
|
|
enum reg_class cl = recog_op_alt[i][alt].cl;
|
2002-01-01 00:16:08 +01:00
|
|
|
|
|
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 (op)
|
2002-05-03 14:07:30 +02:00
|
|
|
|
&& REGNO (op) == ORIGINAL_REGNO (op))
|
2002-01-01 00:16:08 +01:00
|
|
|
|
continue;
|
|
|
|
|
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, loc, cl, mark_write, OP_OUT,
|
2002-01-01 00:16:08 +01:00
|
|
|
|
recog_op_alt[i][alt].earlyclobber);
|
|
|
|
|
}
|
|
|
|
|
}
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
else if (!CALL_P (insn))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
for (i = 0; i < n_ops + recog_data.n_dups; i++)
|
|
|
|
|
{
|
|
|
|
|
int opn = i < n_ops ? i : recog_data.dup_num[i - n_ops];
|
|
|
|
|
rtx *loc = (i < n_ops
|
|
|
|
|
? recog_data.operand_loc[opn]
|
|
|
|
|
: recog_data.dup_loc[i - n_ops]);
|
2004-07-25 19:57:24 +02:00
|
|
|
|
enum reg_class cl = recog_op_alt[opn][alt].cl;
|
2000-10-27 22:58:57 +02:00
|
|
|
|
|
|
|
|
|
if (recog_data.operand_type[opn] == OP_OUT)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
scan_rtx (insn, loc, cl, mark_write, OP_OUT,
|
2000-12-22 16:44:42 +01:00
|
|
|
|
recog_op_alt[opn][alt].earlyclobber);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2005-11-16 01:22:15 +01:00
|
|
|
|
/* Step 6B: Record destination regs in REG_FRAME_RELATED_EXPR
|
|
|
|
|
notes for update. */
|
|
|
|
|
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
|
|
|
|
|
if (REG_NOTE_KIND (note) == REG_FRAME_RELATED_EXPR)
|
|
|
|
|
scan_rtx (insn, &XEXP (note, 0), ALL_REGS, mark_access,
|
|
|
|
|
OP_INOUT, 0);
|
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Step 7: Close chains for registers that were never
|
|
|
|
|
really used here. */
|
|
|
|
|
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
|
|
|
|
|
if (REG_NOTE_KIND (note) == REG_UNUSED)
|
2000-12-22 16:44:42 +01:00
|
|
|
|
scan_rtx (insn, &XEXP (note, 0), NO_REGS, terminate_dead,
|
|
|
|
|
OP_IN, 0);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
}
|
basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
fields of a basic block.
* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
final.c, flow.c, function.c, gcse.c, global.c, graph.c,
haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
accessing the `head' and `end' fields of a basic block directly.
* gengtype.c: Add missing piece from earlier patch. Dunno what
I was thinking...
From-SVN: r74520
2003-12-11 01:20:51 +01:00
|
|
|
|
if (insn == BB_END (bb))
|
2000-10-27 22:58:57 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
/* Since we close every chain when we find a REG_DEAD note, anything that
|
|
|
|
|
is still open lives past the basic block, so it can't be renamed. */
|
|
|
|
|
return closed_chains;
|
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
/* Dump all def/use chains in CHAINS to DUMP_FILE. They are
|
2000-10-27 22:58:57 +02:00
|
|
|
|
printed in reverse order as that's how we build them. */
|
2000-04-05 02:32:45 +02:00
|
|
|
|
|
2000-10-27 22:58:57 +02:00
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
dump_def_use_chain (struct du_chain *chains)
|
2000-10-27 22:58:57 +02:00
|
|
|
|
{
|
|
|
|
|
while (chains)
|
2000-04-10 13:23:17 +02:00
|
|
|
|
{
|
2000-10-27 22:58:57 +02:00
|
|
|
|
struct du_chain *this = chains;
|
|
|
|
|
int r = REGNO (*this->loc);
|
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 nregs = hard_regno_nregs[r][GET_MODE (*this->loc)];
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
fprintf (dump_file, "Register %s (%d):", reg_names[r], nregs);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
while (this)
|
|
|
|
|
{
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
fprintf (dump_file, " %d [%s]", INSN_UID (this->insn),
|
2004-07-25 19:57:24 +02:00
|
|
|
|
reg_class_names[this->cl]);
|
2000-10-27 22:58:57 +02:00
|
|
|
|
this = this->next_use;
|
|
|
|
|
}
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
fprintf (dump_file, "\n");
|
2000-10-27 22:58:57 +02:00
|
|
|
|
chains = chains->next_chain;
|
2000-04-10 13:23:17 +02:00
|
|
|
|
}
|
2000-04-05 02:32:45 +02:00
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
/* The following code does forward propagation of hard register copies.
|
|
|
|
|
The object is to eliminate as many dependencies as possible, so that
|
|
|
|
|
we have the most scheduling freedom. As a side effect, we also clean
|
2002-05-03 14:07:30 +02:00
|
|
|
|
up some silly register allocation decisions made by reload. This
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
code may be obsoleted by a new register allocator. */
|
|
|
|
|
|
|
|
|
|
/* For each register, we have a list of registers that contain the same
|
2002-05-03 14:07:30 +02:00
|
|
|
|
value. The OLDEST_REGNO field points to the head of the list, and
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
the NEXT_REGNO field runs through the list. The MODE field indicates
|
|
|
|
|
what mode the data is known to be in; this field is VOIDmode when the
|
|
|
|
|
register is not known to contain valid data. */
|
|
|
|
|
|
|
|
|
|
struct value_data_entry
|
|
|
|
|
{
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
unsigned int oldest_regno;
|
|
|
|
|
unsigned int next_regno;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct value_data
|
|
|
|
|
{
|
|
|
|
|
struct value_data_entry e[FIRST_PSEUDO_REGISTER];
|
2001-12-15 03:24:21 +01:00
|
|
|
|
unsigned int max_value_regs;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
};
|
|
|
|
|
|
2004-08-20 18:53:49 +02:00
|
|
|
|
static void kill_value_one_regno (unsigned, struct value_data *);
|
|
|
|
|
static void kill_value_regno (unsigned, unsigned, struct value_data *);
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static void kill_value (rtx, struct value_data *);
|
|
|
|
|
static void set_value_regno (unsigned, enum machine_mode, struct value_data *);
|
|
|
|
|
static void init_value_data (struct value_data *);
|
|
|
|
|
static void kill_clobbered_value (rtx, rtx, void *);
|
|
|
|
|
static void kill_set_value (rtx, rtx, void *);
|
|
|
|
|
static int kill_autoinc_value (rtx *, void *);
|
|
|
|
|
static void copy_value (rtx, rtx, struct value_data *);
|
|
|
|
|
static bool mode_change_ok (enum machine_mode, enum machine_mode,
|
|
|
|
|
unsigned int);
|
|
|
|
|
static rtx maybe_mode_change (enum machine_mode, enum machine_mode,
|
|
|
|
|
enum machine_mode, unsigned int, unsigned int);
|
|
|
|
|
static rtx find_oldest_value_reg (enum reg_class, rtx, struct value_data *);
|
|
|
|
|
static bool replace_oldest_value_reg (rtx *, enum reg_class, rtx,
|
|
|
|
|
struct value_data *);
|
|
|
|
|
static bool replace_oldest_value_addr (rtx *, enum reg_class,
|
|
|
|
|
enum machine_mode, rtx,
|
|
|
|
|
struct value_data *);
|
|
|
|
|
static bool replace_oldest_value_mem (rtx, rtx, struct value_data *);
|
|
|
|
|
static bool copyprop_hardreg_forward_1 (basic_block, struct value_data *);
|
|
|
|
|
extern void debug_value_data (struct value_data *);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
#ifdef ENABLE_CHECKING
|
2003-07-06 11:56:09 +02:00
|
|
|
|
static void validate_value_data (struct value_data *);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
2004-08-20 18:53:49 +02:00
|
|
|
|
/* Kill register REGNO. This involves removing it from any value
|
|
|
|
|
lists, and resetting the value mode to VOIDmode. This is only a
|
|
|
|
|
helper function; it does not handle any hard registers overlapping
|
|
|
|
|
with REGNO. */
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
static void
|
2004-08-20 18:53:49 +02:00
|
|
|
|
kill_value_one_regno (unsigned int regno, struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
unsigned int i, next;
|
|
|
|
|
|
|
|
|
|
if (vd->e[regno].oldest_regno != regno)
|
|
|
|
|
{
|
|
|
|
|
for (i = vd->e[regno].oldest_regno;
|
|
|
|
|
vd->e[i].next_regno != regno;
|
|
|
|
|
i = vd->e[i].next_regno)
|
|
|
|
|
continue;
|
2001-12-14 07:47:56 +01:00
|
|
|
|
vd->e[i].next_regno = vd->e[regno].next_regno;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
else if ((next = vd->e[regno].next_regno) != INVALID_REGNUM)
|
|
|
|
|
{
|
|
|
|
|
for (i = next; i != INVALID_REGNUM; i = vd->e[i].next_regno)
|
2002-05-03 14:07:30 +02:00
|
|
|
|
vd->e[i].oldest_regno = next;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
vd->e[regno].mode = VOIDmode;
|
|
|
|
|
vd->e[regno].oldest_regno = regno;
|
|
|
|
|
vd->e[regno].next_regno = INVALID_REGNUM;
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
|
validate_value_data (vd);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2004-08-20 18:53:49 +02:00
|
|
|
|
/* Kill the value in register REGNO for NREGS, and any other registers
|
|
|
|
|
whose values overlap. */
|
|
|
|
|
|
|
|
|
|
static void
|
2004-08-20 21:37:10 +02:00
|
|
|
|
kill_value_regno (unsigned int regno, unsigned int nregs,
|
|
|
|
|
struct value_data *vd)
|
2004-08-20 18:53:49 +02:00
|
|
|
|
{
|
|
|
|
|
unsigned int j;
|
|
|
|
|
|
|
|
|
|
/* Kill the value we're told to kill. */
|
|
|
|
|
for (j = 0; j < nregs; ++j)
|
|
|
|
|
kill_value_one_regno (regno + j, vd);
|
|
|
|
|
|
|
|
|
|
/* Kill everything that overlapped what we're told to kill. */
|
|
|
|
|
if (regno < vd->max_value_regs)
|
|
|
|
|
j = 0;
|
|
|
|
|
else
|
|
|
|
|
j = regno - vd->max_value_regs;
|
|
|
|
|
for (; j < regno; ++j)
|
|
|
|
|
{
|
|
|
|
|
unsigned int i, n;
|
|
|
|
|
if (vd->e[j].mode == VOIDmode)
|
|
|
|
|
continue;
|
|
|
|
|
n = hard_regno_nregs[j][vd->e[j].mode];
|
|
|
|
|
if (j + n > regno)
|
|
|
|
|
for (i = 0; i < n; ++i)
|
|
|
|
|
kill_value_one_regno (j + i, vd);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Kill X. This is a convenience function wrapping kill_value_regno
|
2001-12-14 07:47:56 +01:00
|
|
|
|
so that we mind the mode the register is in. */
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
kill_value (rtx x, struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
2005-01-11 22:56:01 +01:00
|
|
|
|
rtx orig_rtx = x;
|
2002-02-13 23:44:12 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == SUBREG)
|
2005-01-11 22:56:01 +01:00
|
|
|
|
{
|
|
|
|
|
x = simplify_subreg (GET_MODE (x), SUBREG_REG (x),
|
|
|
|
|
GET_MODE (SUBREG_REG (x)), SUBREG_BYTE (x));
|
|
|
|
|
if (x == NULL_RTX)
|
|
|
|
|
x = SUBREG_REG (orig_rtx);
|
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (REG_P (x))
|
2001-12-14 07:47:56 +01:00
|
|
|
|
{
|
|
|
|
|
unsigned int regno = REGNO (x);
|
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
|
|
|
|
unsigned int n = hard_regno_nregs[regno][GET_MODE (x)];
|
2001-12-15 03:24:21 +01:00
|
|
|
|
|
2004-08-20 18:53:49 +02:00
|
|
|
|
kill_value_regno (regno, n, vd);
|
2001-12-14 07:47:56 +01:00
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
2001-12-15 03:24:21 +01:00
|
|
|
|
/* Remember that REGNO is valid in MODE. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
set_value_regno (unsigned int regno, enum machine_mode mode,
|
|
|
|
|
struct value_data *vd)
|
2001-12-15 03:24:21 +01:00
|
|
|
|
{
|
|
|
|
|
unsigned int nregs;
|
|
|
|
|
|
|
|
|
|
vd->e[regno].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
|
|
|
|
nregs = hard_regno_nregs[regno][mode];
|
2001-12-15 03:24:21 +01:00
|
|
|
|
if (nregs > vd->max_value_regs)
|
|
|
|
|
vd->max_value_regs = nregs;
|
|
|
|
|
}
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* Initialize VD such that there are no known relationships between regs. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
init_value_data (struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
|
|
|
|
|
{
|
|
|
|
|
vd->e[i].mode = VOIDmode;
|
|
|
|
|
vd->e[i].oldest_regno = i;
|
|
|
|
|
vd->e[i].next_regno = INVALID_REGNUM;
|
|
|
|
|
}
|
2001-12-15 03:24:21 +01:00
|
|
|
|
vd->max_value_regs = 0;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Called through note_stores. If X is clobbered, kill its value. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
kill_clobbered_value (rtx x, rtx set, void *data)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
struct value_data *vd = data;
|
|
|
|
|
if (GET_CODE (set) == CLOBBER)
|
|
|
|
|
kill_value (x, vd);
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-03 14:07:30 +02:00
|
|
|
|
/* Called through note_stores. If X is set, not clobbered, kill its
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
current value and install it as the root of its own value list. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
kill_set_value (rtx x, rtx set, void *data)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
struct value_data *vd = data;
|
2002-02-18 11:57:30 +01:00
|
|
|
|
if (GET_CODE (set) != CLOBBER)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
2001-12-14 07:47:56 +01:00
|
|
|
|
kill_value (x, vd);
|
2002-02-18 11:57:30 +01:00
|
|
|
|
if (REG_P (x))
|
2002-05-03 14:07:30 +02:00
|
|
|
|
set_value_regno (REGNO (x), GET_MODE (x), vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Called through for_each_rtx. Kill any register used as the base of an
|
|
|
|
|
auto-increment expression, and install that register as the root of its
|
|
|
|
|
own value list. */
|
|
|
|
|
|
|
|
|
|
static int
|
2003-07-06 11:56:09 +02:00
|
|
|
|
kill_autoinc_value (rtx *px, void *data)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
rtx x = *px;
|
|
|
|
|
struct value_data *vd = data;
|
|
|
|
|
|
alias.c (rtx_equal_for_memref_p): Use predicates to test rtx classes and new rtx class codes...
2004-02-07 Paolo Bonzini <bonzini@gnu.org>
* alias.c (rtx_equal_for_memref_p): Use predicates
to test rtx classes and new rtx class codes, possibly
splitting conditionals that tested against '<' and 'o'.
* caller-save.c (save_call_clobbered_regs): Likewise.
* combine.c (contains_muldiv, find_split_point, subst,
combine_simplify_rtx, simplify_if_then_else,
simplify_set, simplify_logical, expand_compound_operation,
make_compound_operation, if_then_else_cond, known_cond,
apply_distributive_law, cached_nonzero_bits,
cached_num_sign_bit_copies, simplify_shift_const,
gen_binary, simplify_comparison, update_table_tick,
record_value_for_reg, get_lsat_value_validate): Likewise.
* cse.c (mention_regs, find_best_addr, find_comparison_args,
fold_rtx, cse_insn, invalidate_memory, cse_basic_block):
Likewise.
* emit-rtl.c (copy_insn_1): Likewise.
* expr.c (force_operand): Likewise.
* final.c (final_scan_insn, get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
invalidate_mems_from_autoinc, ior_reg_cond, not_reg_cond,
and_reg_cond, elim_reg_cond): Likewise.
* function.c (update_epilogue_consts): Likewise.
* genattrtab.c (attr_rtx_1): Likewise.
* genopinit.c (gen_insn): Likewise.
* integrate.c (subst_constants): Likewise.
* jump.c (reversed_comparison_code_parts,
reversed_comparison_code, delete_related_insns,
rtx_renumbered_equal_p): Likewise.
* local-alloc.c (block_alloc): Likewise.
* loop.c (rtx_equal_for_prefetch_p, maybe_eliminate_biv,
canonicalize_condition): Likewise.
* loop-iv.c (simplify_using_conditions, iv_number_of_iterations):
Likewise.
* optabs.c (add_equal_node, expand_binop): Likewise.
* predict.c (estimate_probability): Likewise.
* ra-debug.c (ra_print_rtx_2op, ra_print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, comparison_operator,
offsettable_address_p, constrain_operands): Likewise.
* reg-stack.c (swap_rtx_condition_1, subst_stack_regs_pat):
Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (stable_and_no_regs_but_for_p): Likewise.
* regrename.c (kill_autoinc_value): Likewise.
* reload.c (find_reusable_reload, find_reloads,
reg_overlap_mentioned_for_reload_p): Likewise.
* reload1.c (gen_reload, delete_address_reloads_1): Likewise.
* rtl.c (copy_rtx): Likewise.
* rtl.h (CONSTANT_P, INSN_P): Likewise.
* rtlanal.c (commutative_operand_precedence): Likewise.
* sched-deps.c (conditions_mutex_p): Likewise.
* sched-rgn.c (is_cfg_nonregular): Likewise.
* simplify-rtx.c (simplify_gen_binary,
simplify_gen_relational, simplify_replace_rtx,
simplify_unary_operation, simplify_binary_operation,
simplify_ternary_operation, simplify_rtx): Likewise.
* unroll.c (reg_dead_after_loop): Likewise.
* config/alpha/alpha.c (alpha_swapped_comparison_operator,
print_operand): Likewise.
* config/arc/arc.c (proper_comparison_operator): Likewise.
* config/arm/arm.c (arm_arm_address_cost, arm_select_cc_mode):
Likewise.
* config/avr/avr.c (_reg_unused_after): Likewise.
* config/frv/frv.c (frv_ifcvt_modify_tests,
frv_ifcvt_modify_insn, frv_pack_insn): Likewise.
* config/i386/i386.c (ix86_comparison_operator,
ix86_carry_flag_operator, fcmov_comparison_operator,
arith_or_logical_operator, print_operand,
ix86_expand_binary_operator, ix86_binary_operator_ok):
Likewise.
* config/i386/i386.md: Likewise.
* config/ia64/ia64.c (not_postinc_memory_operand,
ia64_print_operand, update_set_flags, errata_emit_nops):
Likewise.
* config/ia64/ia64.h (PREFERRED_RELOAD_CLASS,
CONSTRAINT_OK_FOR_S): Likewise.
* config/ip2k/ip2k.c (mdr_resequence_xy_yx,
mdr_try_move_dp_reload, ip2k_check_can_adjust_stack_ref,
ip2k_xexp_not_uses_reg_for_mem, ip2k_xexp_not_uses_reg_p,
ip2k_composite_xexp_not_uses_reg_p, ip2k_unary_operator):
Likewise.
* config/iq2000/iq2000.c (cmp_op, symbolic_expression_p,
eqne_comparison_operator, signed_comparison_operator):
Likewise.
* config/mips/mips.c (cmp_op, symbolic_expression_p):
Likewise.
* config/mmix/mmix (mmix_foldable_comparison_operator,
mmix_comparison_operator): Likewise.
* config/pa/pa.c (hppa_legitimize_address): Likewise.
* config/rs6000/rs6000.c (stmw_operation,
branch_comparison_operator, trap_comparison_operator,
ccr_bit): Likewise.
* config/rs6000/rs6000.h (SELECT_CC_MODE): Likewise.
* config/s390/s390.c (s390_alc_comparison,
s390_slb_comparison):L Likewise.
* config/sh/sh.c (gen_block_redirect, reg_unused_after):
Likewise.
* config/sparc/sparc.c (eq_or_neq, normal_comp_operator,
noov_compare_op, noov_compare64_op, v9_regcmp_op,
emit_hard_tfmode_operation, reg_unused_after)
* doc/md.texi, doc/rtl.texi: Likewise.
* ra-debug.c: Add 2004 to list of copyright years.
* unroll.c: Likewise.
* combine.c (simplify_logical): Remove dummy test,
(apply_distributive_law): Fix typo in comment.
GET_CODE (x) == AND so x is a commutative binary op.
* jump.c (delete_related_insns): simplify loop
condition, move testing of RTX codes inside the loop.
(rtx_renumbered_equal_p): do not use RTX_CODE.
* rtl.c (rtx_class): Declare as enum rtx_class.
* rtl.def (EQ, NE, UNEQ, LTGT, UNORDERED, ORDERED):
Move to RTX_COMM_COMPARE class.
(HIGH, SYMBOL_REF, LABEL_REF, CONST, CONST_INT, CONST_DOUBLE):
Move to RTX_CONST_OBJ class.
* rtl.h (enum rtx_class): New declaration,
(RTX_OBJ_MASK, RTX_OBJ_RESULT, RTX_COMPARE_MASK,
RTX_COMPARE_RESULT, RTX_ARITHMETIC_MASK, RTX_ARITHMETIC_RESULT,
RTX_BINARY_MASK, RTX_BINARY_RESULT, RTX_COMMUTATIVE_MASK,
RTX_COMMUTATIVE_RESULT, RTX_NON_COMMUTATIVE_RESULT,
RTX_EXPR_FIRST, RTX_EXPR_LAST, UNARY_P, BINARY_P,
ARITHMETIC_P, COMMUTATIVE_ARITHMETIC_P, COMPARISON_P,
SWAPPABLE_OPERANDS_P, NON_COMMUTATIVE_P, COMMUTATIVE_P,
OBJECT_P): New macros.
* config/sparc/sparc.c (noov_compare_op): Remove register
from parameter.
From-SVN: r78824
2004-03-03 09:35:33 +01:00
|
|
|
|
if (GET_RTX_CLASS (GET_CODE (x)) == RTX_AUTOINC)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
2001-12-14 07:47:56 +01:00
|
|
|
|
x = XEXP (x, 0);
|
|
|
|
|
kill_value (x, vd);
|
2001-12-15 03:24:21 +01:00
|
|
|
|
set_value_regno (REGNO (x), Pmode, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Assert that SRC has been copied to DEST. Adjust the data structures
|
|
|
|
|
to reflect that SRC contains an older copy of the shared value. */
|
|
|
|
|
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
copy_value (rtx dest, rtx src, struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
unsigned int dr = REGNO (dest);
|
|
|
|
|
unsigned int sr = REGNO (src);
|
2002-01-09 02:07:13 +01:00
|
|
|
|
unsigned int dn, sn;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
|
|
/* ??? At present, it's possible to see noop sets. It'd be nice if
|
|
|
|
|
this were cleaned up beforehand... */
|
|
|
|
|
if (sr == dr)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Do not propagate copies to the stack pointer, as that can leave
|
2002-09-14 15:12:56 +02:00
|
|
|
|
memory accesses with no scheduling dependency on the stack update. */
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (dr == STACK_POINTER_REGNUM)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Likewise with the frame pointer, if we're using one. */
|
|
|
|
|
if (frame_pointer_needed && dr == HARD_FRAME_POINTER_REGNUM)
|
|
|
|
|
return;
|
|
|
|
|
|
2005-06-27 10:11:00 +02:00
|
|
|
|
/* Do not propagate copies to fixed or global registers, patterns
|
|
|
|
|
can be relying to see particular fixed register or users can
|
|
|
|
|
expect the chosen global register in asm. */
|
2005-06-26 07:20:30 +02:00
|
|
|
|
if (fixed_regs[dr] || global_regs[dr])
|
|
|
|
|
return;
|
|
|
|
|
|
2002-01-09 02:07:13 +01:00
|
|
|
|
/* If SRC and DEST overlap, don't record anything. */
|
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
|
|
|
|
dn = hard_regno_nregs[dr][GET_MODE (dest)];
|
|
|
|
|
sn = hard_regno_nregs[sr][GET_MODE (dest)];
|
2002-01-09 02:07:13 +01:00
|
|
|
|
if ((dr > sr && dr < sr + sn)
|
|
|
|
|
|| (sr > dr && sr < dr + dn))
|
|
|
|
|
return;
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* If SRC had no assigned mode (i.e. we didn't know it was live)
|
|
|
|
|
assign it now and assume the value came from an input argument
|
|
|
|
|
or somesuch. */
|
|
|
|
|
if (vd->e[sr].mode == VOIDmode)
|
2001-12-15 03:24:21 +01:00
|
|
|
|
set_value_regno (sr, vd->e[dr].mode, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
2002-08-22 01:24:14 +02:00
|
|
|
|
/* If we are narrowing the input to a smaller number of hard regs,
|
2002-07-16 22:13:35 +02:00
|
|
|
|
and it is in big endian, we are really extracting a high part.
|
|
|
|
|
Since we generally associate a low part of a value with the value itself,
|
|
|
|
|
we must not do the same for the high part.
|
|
|
|
|
Note we can still get low parts for the same mode combination through
|
|
|
|
|
a two-step copy involving differently sized hard regs.
|
|
|
|
|
Assume hard regs fr* are 32 bits bits each, while r* are 64 bits each:
|
|
|
|
|
(set (reg:DI r0) (reg:DI fr0))
|
|
|
|
|
(set (reg:SI fr2) (reg:SI r0))
|
|
|
|
|
loads the low part of (reg:DI fr0) - i.e. fr1 - into fr2, while:
|
|
|
|
|
(set (reg:SI fr2) (reg:SI fr0))
|
|
|
|
|
loads the high part of (reg:DI fr0) into fr2.
|
|
|
|
|
|
|
|
|
|
We can't properly represent the latter case in our tables, so don't
|
|
|
|
|
record anything then. */
|
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
|
|
|
|
else if (sn < (unsigned int) hard_regno_nregs[sr][vd->e[sr].mode]
|
2002-07-16 22:13:35 +02:00
|
|
|
|
&& (GET_MODE_SIZE (vd->e[sr].mode) > UNITS_PER_WORD
|
|
|
|
|
? WORDS_BIG_ENDIAN : BYTES_BIG_ENDIAN))
|
|
|
|
|
return;
|
|
|
|
|
|
2002-01-09 21:54:49 +01:00
|
|
|
|
/* If SRC had been assigned a mode narrower than the copy, we can't
|
|
|
|
|
link DEST into the chain, because not all of the pieces of the
|
|
|
|
|
copy came from oldest_regno. */
|
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
|
|
|
|
else if (sn > (unsigned int) hard_regno_nregs[sr][vd->e[sr].mode])
|
2002-01-09 21:54:49 +01:00
|
|
|
|
return;
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* Link DR at the end of the value chain used by SR. */
|
|
|
|
|
|
|
|
|
|
vd->e[dr].oldest_regno = vd->e[sr].oldest_regno;
|
|
|
|
|
|
|
|
|
|
for (i = sr; vd->e[i].next_regno != INVALID_REGNUM; i = vd->e[i].next_regno)
|
|
|
|
|
continue;
|
|
|
|
|
vd->e[i].next_regno = dr;
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
|
validate_value_data (vd);
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
2001-12-15 03:25:41 +01:00
|
|
|
|
/* Return true if a mode change from ORIG to NEW is allowed for REGNO. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2003-07-06 11:56:09 +02:00
|
|
|
|
mode_change_ok (enum machine_mode orig_mode, enum machine_mode new_mode,
|
|
|
|
|
unsigned int regno ATTRIBUTE_UNUSED)
|
2001-12-15 03:25:41 +01:00
|
|
|
|
{
|
|
|
|
|
if (GET_MODE_SIZE (orig_mode) < GET_MODE_SIZE (new_mode))
|
|
|
|
|
return false;
|
|
|
|
|
|
2002-11-04 17:58:39 +01:00
|
|
|
|
#ifdef CANNOT_CHANGE_MODE_CLASS
|
|
|
|
|
return !REG_CANNOT_CHANGE_MODE_P (regno, orig_mode, new_mode);
|
2001-12-15 03:25:41 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2002-07-17 20:24:46 +02:00
|
|
|
|
/* Register REGNO was originally set in ORIG_MODE. It - or a copy of it -
|
|
|
|
|
was copied in COPY_MODE to COPY_REGNO, and then COPY_REGNO was accessed
|
|
|
|
|
in NEW_MODE.
|
|
|
|
|
Return a NEW_MODE rtx for REGNO if that's OK, otherwise return NULL_RTX. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2003-07-06 11:56:09 +02:00
|
|
|
|
maybe_mode_change (enum machine_mode orig_mode, enum machine_mode copy_mode,
|
|
|
|
|
enum machine_mode new_mode, unsigned int regno,
|
|
|
|
|
unsigned int copy_regno ATTRIBUTE_UNUSED)
|
2002-07-17 20:24:46 +02:00
|
|
|
|
{
|
|
|
|
|
if (orig_mode == new_mode)
|
|
|
|
|
return gen_rtx_raw_REG (new_mode, regno);
|
|
|
|
|
else if (mode_change_ok (orig_mode, new_mode, regno))
|
|
|
|
|
{
|
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 copy_nregs = hard_regno_nregs[copy_regno][copy_mode];
|
|
|
|
|
int use_nregs = hard_regno_nregs[copy_regno][new_mode];
|
2002-07-17 20:24:46 +02:00
|
|
|
|
int copy_offset
|
|
|
|
|
= GET_MODE_SIZE (copy_mode) / copy_nregs * (copy_nregs - use_nregs);
|
|
|
|
|
int offset
|
|
|
|
|
= GET_MODE_SIZE (orig_mode) - GET_MODE_SIZE (new_mode) - copy_offset;
|
|
|
|
|
int byteoffset = offset % UNITS_PER_WORD;
|
|
|
|
|
int wordoffset = offset - byteoffset;
|
|
|
|
|
|
|
|
|
|
offset = ((WORDS_BIG_ENDIAN ? wordoffset : 0)
|
|
|
|
|
+ (BYTES_BIG_ENDIAN ? byteoffset : 0));
|
|
|
|
|
return gen_rtx_raw_REG (new_mode,
|
|
|
|
|
regno + subreg_regno_offset (regno, orig_mode,
|
|
|
|
|
offset,
|
|
|
|
|
new_mode));
|
|
|
|
|
}
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* Find the oldest copy of the value contained in REGNO that is in
|
2004-07-25 19:57:24 +02:00
|
|
|
|
register class CL and has mode MODE. If found, return an rtx
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
of that oldest register, otherwise return NULL. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2004-07-25 19:57:24 +02:00
|
|
|
|
find_oldest_value_reg (enum reg_class cl, rtx reg, struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
2002-01-01 00:16:08 +01:00
|
|
|
|
unsigned int regno = REGNO (reg);
|
|
|
|
|
enum machine_mode mode = GET_MODE (reg);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
unsigned int i;
|
|
|
|
|
|
2002-01-08 07:13:34 +01:00
|
|
|
|
/* If we are accessing REG in some mode other that what we set it in,
|
|
|
|
|
make sure that the replacement is valid. In particular, consider
|
|
|
|
|
(set (reg:DI r11) (...))
|
|
|
|
|
(set (reg:SI r9) (reg:SI r11))
|
|
|
|
|
(set (reg:SI r10) (...))
|
|
|
|
|
(set (...) (reg:DI r9))
|
|
|
|
|
Replacing r9 with r11 is invalid. */
|
|
|
|
|
if (mode != vd->e[regno].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 (hard_regno_nregs[regno][mode]
|
|
|
|
|
> hard_regno_nregs[regno][vd->e[regno].mode])
|
2002-01-08 07:13:34 +01:00
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
for (i = vd->e[regno].oldest_regno; i != regno; i = vd->e[i].next_regno)
|
2002-07-16 12:59:15 +02:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode oldmode = vd->e[i].mode;
|
2002-07-17 20:24:46 +02:00
|
|
|
|
rtx new;
|
2002-07-16 12:59:15 +02:00
|
|
|
|
|
2007-05-22 22:52:39 +02:00
|
|
|
|
if (!in_hard_reg_set_p (reg_class_contents[cl], mode, i))
|
|
|
|
|
return NULL_RTX;
|
2004-01-14 17:25:09 +01:00
|
|
|
|
|
2004-01-14 18:55:20 +01:00
|
|
|
|
new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i, regno);
|
|
|
|
|
if (new)
|
2004-01-14 17:25:09 +01:00
|
|
|
|
{
|
|
|
|
|
ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg);
|
|
|
|
|
REG_ATTRS (new) = REG_ATTRS (reg);
|
|
|
|
|
return new;
|
|
|
|
|
}
|
2002-07-16 12:59:15 +02:00
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If possible, replace the register at *LOC with the oldest register
|
2004-07-25 19:57:24 +02:00
|
|
|
|
in register class CL. Return true if successfully replaced. */
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
static bool
|
2004-07-25 19:57:24 +02:00
|
|
|
|
replace_oldest_value_reg (rtx *loc, enum reg_class cl, rtx insn,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
2004-07-25 19:57:24 +02:00
|
|
|
|
rtx new = find_oldest_value_reg (cl, *loc, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (new)
|
|
|
|
|
{
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file, "insn %u: replaced reg %u with %u\n",
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
INSN_UID (insn), REGNO (*loc), REGNO (new));
|
|
|
|
|
|
2005-12-23 10:43:36 +01:00
|
|
|
|
validate_change (insn, loc, new, 1);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar to replace_oldest_value_reg, but *LOC contains an address.
|
2004-07-25 19:57:24 +02:00
|
|
|
|
Adapted from find_reloads_address_1. CL is INDEX_REG_CLASS or
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
BASE_REG_CLASS depending on how the register is being considered. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2004-07-25 19:57:24 +02:00
|
|
|
|
replace_oldest_value_addr (rtx *loc, enum reg_class cl,
|
2003-07-06 11:56:09 +02:00
|
|
|
|
enum machine_mode mode, rtx insn,
|
|
|
|
|
struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
rtx x = *loc;
|
|
|
|
|
RTX_CODE code = GET_CODE (x);
|
|
|
|
|
const char *fmt;
|
|
|
|
|
int i, j;
|
|
|
|
|
bool changed = false;
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
|
|
|
|
{
|
|
|
|
|
rtx orig_op0 = XEXP (x, 0);
|
|
|
|
|
rtx orig_op1 = XEXP (x, 1);
|
|
|
|
|
RTX_CODE code0 = GET_CODE (orig_op0);
|
|
|
|
|
RTX_CODE code1 = GET_CODE (orig_op1);
|
|
|
|
|
rtx op0 = orig_op0;
|
|
|
|
|
rtx op1 = orig_op1;
|
|
|
|
|
rtx *locI = NULL;
|
|
|
|
|
rtx *locB = NULL;
|
2006-03-27 18:25:16 +02:00
|
|
|
|
enum rtx_code index_code = SCRATCH;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (op0) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
op0 = SUBREG_REG (op0);
|
|
|
|
|
code0 = GET_CODE (op0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op1) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
op1 = SUBREG_REG (op1);
|
|
|
|
|
code1 = GET_CODE (op1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (code0 == MULT || code0 == SIGN_EXTEND || code0 == TRUNCATE
|
|
|
|
|
|| code0 == ZERO_EXTEND || code1 == MEM)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 0);
|
|
|
|
|
locB = &XEXP (x, 1);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
else if (code1 == MULT || code1 == SIGN_EXTEND || code1 == TRUNCATE
|
|
|
|
|
|| code1 == ZERO_EXTEND || code0 == MEM)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 1);
|
|
|
|
|
locB = &XEXP (x, 0);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
else if (code0 == CONST_INT || code0 == CONST
|
|
|
|
|
|| code0 == SYMBOL_REF || code0 == LABEL_REF)
|
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
|
|
|
|
{
|
|
|
|
|
locB = &XEXP (x, 1);
|
|
|
|
|
index_code = GET_CODE (XEXP (x, 0));
|
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
else if (code1 == CONST_INT || code1 == CONST
|
|
|
|
|
|| code1 == SYMBOL_REF || code1 == LABEL_REF)
|
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
|
|
|
|
{
|
|
|
|
|
locB = &XEXP (x, 0);
|
|
|
|
|
index_code = GET_CODE (XEXP (x, 1));
|
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
else if (code0 == REG && code1 == REG)
|
|
|
|
|
{
|
|
|
|
|
int index_op;
|
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
|
|
|
|
unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
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
|
|
|
|
if (REGNO_OK_FOR_INDEX_P (regno0)
|
|
|
|
|
&& regno_ok_for_base_p (regno1, mode, PLUS, REG))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
index_op = 0;
|
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
|
|
|
|
else if (REGNO_OK_FOR_INDEX_P (regno1)
|
|
|
|
|
&& regno_ok_for_base_p (regno0, mode, PLUS, REG))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
index_op = 1;
|
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
|
|
|
|
else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
index_op = 0;
|
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
|
|
|
|
else if (regno_ok_for_base_p (regno0, mode, PLUS, REG))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
index_op = 1;
|
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
|
|
|
|
else if (REGNO_OK_FOR_INDEX_P (regno1))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
index_op = 1;
|
|
|
|
|
else
|
|
|
|
|
index_op = 0;
|
|
|
|
|
|
|
|
|
|
locI = &XEXP (x, index_op);
|
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
|
|
|
|
locB = &XEXP (x, !index_op);
|
|
|
|
|
index_code = GET_CODE (*locI);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
else if (code0 == REG)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 0);
|
|
|
|
|
locB = &XEXP (x, 1);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
else if (code1 == REG)
|
|
|
|
|
{
|
|
|
|
|
locI = &XEXP (x, 1);
|
|
|
|
|
locB = &XEXP (x, 0);
|
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
|
|
|
|
index_code = GET_CODE (*locI);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (locI)
|
|
|
|
|
changed |= replace_oldest_value_addr (locI, INDEX_REG_CLASS, mode,
|
2002-05-03 14:07:30 +02:00
|
|
|
|
insn, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (locB)
|
2001-12-17 17:46:11 +01:00
|
|
|
|
changed |= replace_oldest_value_addr (locB,
|
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
|
|
|
|
base_reg_class (mode, PLUS,
|
|
|
|
|
index_code),
|
2004-10-12 21:28:56 +02:00
|
|
|
|
mode, insn, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case POST_INC:
|
|
|
|
|
case POST_DEC:
|
|
|
|
|
case POST_MODIFY:
|
|
|
|
|
case PRE_INC:
|
|
|
|
|
case PRE_DEC:
|
|
|
|
|
case PRE_MODIFY:
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
case MEM:
|
|
|
|
|
return replace_oldest_value_mem (x, insn, vd);
|
|
|
|
|
|
|
|
|
|
case REG:
|
2004-07-25 19:57:24 +02:00
|
|
|
|
return replace_oldest_value_reg (loc, cl, insn, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
if (fmt[i] == 'e')
|
2004-07-25 19:57:24 +02:00
|
|
|
|
changed |= replace_oldest_value_addr (&XEXP (x, i), cl, mode,
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
insn, vd);
|
|
|
|
|
else if (fmt[i] == 'E')
|
|
|
|
|
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
changed |= replace_oldest_value_addr (&XVECEXP (x, i, j), cl,
|
2002-05-03 14:07:30 +02:00
|
|
|
|
mode, insn, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar to replace_oldest_value_reg, but X contains a memory. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2003-07-06 11:56:09 +02:00
|
|
|
|
replace_oldest_value_mem (rtx x, rtx insn, struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
2001-12-17 17:46:11 +01:00
|
|
|
|
return replace_oldest_value_addr (&XEXP (x, 0),
|
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
|
|
|
|
base_reg_class (GET_MODE (x), MEM,
|
|
|
|
|
SCRATCH),
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
GET_MODE (x), insn, vd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Perform the forward copy propagation on basic block BB. */
|
|
|
|
|
|
|
|
|
|
static bool
|
2003-07-06 11:56:09 +02:00
|
|
|
|
copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
bool changed = false;
|
|
|
|
|
rtx insn;
|
|
|
|
|
|
basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
fields of a basic block.
* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
final.c, flow.c, function.c, gcse.c, global.c, graph.c,
haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
accessing the `head' and `end' fields of a basic block directly.
* gengtype.c: Add missing piece from earlier patch. Dunno what
I was thinking...
From-SVN: r74520
2003-12-11 01:20:51 +01:00
|
|
|
|
for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
int n_ops, i, alt, predicated;
|
2005-12-23 10:43:36 +01:00
|
|
|
|
bool is_asm, any_replacements;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
rtx set;
|
2005-12-23 10:43:36 +01:00
|
|
|
|
bool replaced[MAX_RECOG_OPERANDS];
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
if (! INSN_P (insn))
|
|
|
|
|
{
|
basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
fields of a basic block.
* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
final.c, flow.c, function.c, gcse.c, global.c, graph.c,
haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
accessing the `head' and `end' fields of a basic block directly.
* gengtype.c: Add missing piece from earlier patch. Dunno what
I was thinking...
From-SVN: r74520
2003-12-11 01:20:51 +01:00
|
|
|
|
if (insn == BB_END (bb))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
break;
|
|
|
|
|
else
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set = single_set (insn);
|
|
|
|
|
extract_insn (insn);
|
2002-04-30 23:39:46 +02:00
|
|
|
|
if (! constrain_operands (1))
|
2002-05-03 14:07:30 +02:00
|
|
|
|
fatal_insn_not_found (insn);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
preprocess_constraints ();
|
|
|
|
|
alt = which_alternative;
|
|
|
|
|
n_ops = recog_data.n_operands;
|
2002-01-01 00:16:08 +01:00
|
|
|
|
is_asm = asm_noperands (PATTERN (insn)) >= 0;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
/* Simplify the code below by rewriting things to reflect
|
|
|
|
|
matching constraints. Also promote OP_OUT to OP_INOUT
|
|
|
|
|
in predicated instructions. */
|
|
|
|
|
|
|
|
|
|
predicated = GET_CODE (PATTERN (insn)) == COND_EXEC;
|
|
|
|
|
for (i = 0; i < n_ops; ++i)
|
|
|
|
|
{
|
|
|
|
|
int matches = recog_op_alt[i][alt].matches;
|
|
|
|
|
if (matches >= 0)
|
2004-07-25 19:57:24 +02:00
|
|
|
|
recog_op_alt[i][alt].cl = recog_op_alt[matches][alt].cl;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (matches >= 0 || recog_op_alt[i][alt].matched >= 0
|
|
|
|
|
|| (predicated && recog_data.operand_type[i] == OP_OUT))
|
|
|
|
|
recog_data.operand_type[i] = OP_INOUT;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For each earlyclobber operand, zap the value data. */
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
if (recog_op_alt[i][alt].earlyclobber)
|
|
|
|
|
kill_value (recog_data.operand[i], vd);
|
|
|
|
|
|
|
|
|
|
/* Within asms, a clobber cannot overlap inputs or outputs.
|
|
|
|
|
I wouldn't think this were true for regular insns, but
|
|
|
|
|
scan_rtx treats them like that... */
|
|
|
|
|
note_stores (PATTERN (insn), kill_clobbered_value, vd);
|
|
|
|
|
|
|
|
|
|
/* Kill all auto-incremented values. */
|
|
|
|
|
/* ??? REG_INC is useless, since stack pushes aren't done that way. */
|
|
|
|
|
for_each_rtx (&PATTERN (insn), kill_autoinc_value, vd);
|
|
|
|
|
|
2001-12-15 03:24:21 +01:00
|
|
|
|
/* Kill all early-clobbered operands. */
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
if (recog_op_alt[i][alt].earlyclobber)
|
|
|
|
|
kill_value (recog_data.operand[i], vd);
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* Special-case plain move instructions, since we may well
|
|
|
|
|
be able to do the move from a different register class. */
|
|
|
|
|
if (set && REG_P (SET_SRC (set)))
|
|
|
|
|
{
|
2002-01-01 00:16:08 +01:00
|
|
|
|
rtx src = SET_SRC (set);
|
|
|
|
|
unsigned int regno = REGNO (src);
|
|
|
|
|
enum machine_mode mode = GET_MODE (src);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
unsigned int i;
|
|
|
|
|
rtx new;
|
|
|
|
|
|
2002-01-08 07:13:34 +01:00
|
|
|
|
/* If we are accessing SRC in some mode other that what we
|
|
|
|
|
set it in, make sure that the replacement is valid. */
|
|
|
|
|
if (mode != vd->e[regno].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 (hard_regno_nregs[regno][mode]
|
|
|
|
|
> hard_regno_nregs[regno][vd->e[regno].mode])
|
2002-01-08 07:13:34 +01:00
|
|
|
|
goto no_move_special_case;
|
|
|
|
|
}
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* If the destination is also a register, try to find a source
|
|
|
|
|
register in the same class. */
|
|
|
|
|
if (REG_P (SET_DEST (set)))
|
|
|
|
|
{
|
2002-01-01 00:16:08 +01:00
|
|
|
|
new = find_oldest_value_reg (REGNO_REG_CLASS (regno), src, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (new && validate_change (insn, &SET_SRC (set), new, 0))
|
|
|
|
|
{
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file,
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
"insn %u: replaced reg %u with %u\n",
|
|
|
|
|
INSN_UID (insn), regno, REGNO (new));
|
2002-05-03 14:07:30 +02:00
|
|
|
|
changed = true;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
goto did_replacement;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Otherwise, try all valid registers and see if its valid. */
|
|
|
|
|
for (i = vd->e[regno].oldest_regno; i != regno;
|
|
|
|
|
i = vd->e[i].next_regno)
|
2002-07-17 20:24:46 +02:00
|
|
|
|
{
|
|
|
|
|
new = maybe_mode_change (vd->e[i].mode, vd->e[regno].mode,
|
|
|
|
|
mode, i, regno);
|
|
|
|
|
if (new != NULL_RTX)
|
|
|
|
|
{
|
|
|
|
|
if (validate_change (insn, &SET_SRC (set), new, 0))
|
|
|
|
|
{
|
|
|
|
|
ORIGINAL_REGNO (new) = ORIGINAL_REGNO (src);
|
2003-02-07 02:20:04 +01:00
|
|
|
|
REG_ATTRS (new) = REG_ATTRS (src);
|
toplev.c (dump_file_tbl): Rename from dump_file.
* toplev.c (dump_file_tbl): Rename from dump_file.
* bb-reorder.c, bt-load.c, cfgcleanup.c, cfglayout.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, config/arm/arm.c, config/frv/frv.c,
config/i386/i386.c, config/ia64/ia64.c, config/mips/mips.c,
config/sh/sh.c, cse.c, flow.c, ifcvt.c, loop-iv.c, loop-unroll.c,
loop-unswitch.c, output.h, predict.c, profile.c, ra-build.c,
ra-colorize.c, ra-debug.c, ra-rewrite.c, ra.c, regrename.c, reload1.c,
toplev.c, tracer.c, value-prof.c, var-tracking.c, web.c:
s/rtl_dump_file/dump_file/g.
From-SVN: r78399
2004-02-25 00:40:03 +01:00
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file,
|
2002-07-17 20:24:46 +02:00
|
|
|
|
"insn %u: replaced reg %u with %u\n",
|
|
|
|
|
INSN_UID (insn), regno, REGNO (new));
|
|
|
|
|
changed = true;
|
|
|
|
|
goto did_replacement;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
2002-01-08 07:13:34 +01:00
|
|
|
|
no_move_special_case:
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
2005-12-23 10:43:36 +01:00
|
|
|
|
any_replacements = false;
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* For each input operand, replace a hard register with the
|
|
|
|
|
eldest live copy that's in an appropriate register class. */
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
{
|
2005-12-23 10:43:36 +01:00
|
|
|
|
replaced[i] = false;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
/* Don't scan match_operand here, since we've no reg class
|
|
|
|
|
information to pass down. Any operands that we could
|
|
|
|
|
substitute in will be represented elsewhere. */
|
|
|
|
|
if (recog_data.constraints[i][0] == '\0')
|
|
|
|
|
continue;
|
|
|
|
|
|
2002-01-01 00:16:08 +01:00
|
|
|
|
/* Don't replace in asms intentionally referencing hard regs. */
|
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 (is_asm && REG_P (recog_data.operand[i])
|
2002-01-01 00:16:08 +01:00
|
|
|
|
&& (REGNO (recog_data.operand[i])
|
|
|
|
|
== ORIGINAL_REGNO (recog_data.operand[i])))
|
|
|
|
|
continue;
|
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
if (recog_data.operand_type[i] == OP_IN)
|
|
|
|
|
{
|
|
|
|
|
if (recog_op_alt[i][alt].is_address)
|
2005-12-23 10:43:36 +01:00
|
|
|
|
replaced[i]
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
= replace_oldest_value_addr (recog_data.operand_loc[i],
|
2004-07-25 19:57:24 +02:00
|
|
|
|
recog_op_alt[i][alt].cl,
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
VOIDmode, insn, vd);
|
|
|
|
|
else if (REG_P (recog_data.operand[i]))
|
2005-12-23 10:43:36 +01:00
|
|
|
|
replaced[i]
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
= replace_oldest_value_reg (recog_data.operand_loc[i],
|
2004-07-25 19:57:24 +02:00
|
|
|
|
recog_op_alt[i][alt].cl,
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
insn, vd);
|
alias.c (get_alias_set, [...]): Use MEM_P.
2004-07-01 Jerry Quinn <jlquinn@optonline.net>
* alias.c (get_alias_set, canon_rtx, get_addr,
nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1):
Use MEM_P.
* builtins.c (expand_builtin_prefetch, expand_builtin_profile_func,
expand_builtin): Likewise.
* calls.c (expand_call, emit_library_call_value_1, store_one_arg):
Likewise.
* combine.c (can_combine_p, combinable_i3pat, try_combine,
find_split_point, combine_simplify_rtx, simplify_set, make_extraction,
rtx_equal_for_field_assignment_p, gen_lowpart_for_combine,
record_dead_and_set_regs_1, get_last_value_validate,
mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise.
* cse.c (check_dependence, canon_hash, equiv_constant,
gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers,
cse_around_loop, cse_check_loop_start, cse_set_around_loop,
count_reg_usage): Likewise.
* cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup,
cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set,
cselib_record_sets): Likewise.
* dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol,
dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise.
* ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise.
* df.c (df_uses_record): Likewise.
* dojump (do_jump): Likewise.
* dwarf2out.c (stack_adjust_offset, mem_loc_descriptor,
loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info,
decl_start_label): Likewise.
* emit-rtl.c (gen_complex_constant_part, gen_highpart,
operand_subword, change_address_1, make_safe_from): Likewise.
* explow.c (break_out_memory_refs, copy_all_regs, validize_mem,
stabilize, force_not_mem): Likewise.
* expmed.c (store_bit_field, store_split_bit_field, extract_bit_field,
expand_mult_const, expand_divmod, emit_store_flag): Likewise.
* expr.c (convert_move, convert_modes, emit_block_move,
emit_group_load, emit_group_store, clear_storage, emit_move_insn,
emit_move_insn_1, expand_assignment, store_expr,
store_constructor_field, store_constructor, store_field,
force_operand, safe_from_p, expand_expr_real_1, expand_increment):
Likewise.
* final.c (cleanup_subreg_operands, alter_subreg,
get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs):
Likewise.
* function.c (mark_temp_addr_taken, preserve_temp_slots,
preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1,
optimize_bit_field, flush_addressof, purge_addressof_1,
instantiate_decl, instantiate_virtual_regs_1, assign_parms,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
keep_stack_depressed): Likewise.
* ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok,
noce_process_if_block, find_memory): Likewise.
* integrate.c (subst_constants, allocate_initial_values): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p,
update_equiv_regs): Likewise.
* loop.c (scan_loop, prescan_loop, note_addr_stored, check_store,
maybe_eliminate_biv_1, find_mem_in_note_1): Likewise.
* optabs.c (expand_abs, emit_unop_insn): Likewise.
* passes.c (rest_of_handle_final): Likewise.
* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands,
move2add_note_store): Likewise.
* ra-build.c (detect_remat_webs): Likewise.
* ra-debug.c (dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, insert_stores): Likewise.
* recog.c (validate_change, apply_change_group, cancel_changes,
validate_replace_rtx_1, general_operand, register_operand,
nonmemory_operand, push_operand, pop_operand, memory_operand,
indirect_operand, asm_operand_ok, offsettable_memref_p,
offsettable_nonstrict_memref_p, constrain_operands,
store_data_bypass_p): Likewise.
* reg-stack.c (subst_stack_regs_pat): Likewise.
* regclass.c (record_operand_costs, scan_one_insn, record_reg_classes,
copy_cost, reg_scan_mark_refs): Likewise.
* regmove.c (optimize_reg_copy_3, stack_memref_p,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (copyprop_hardreg_forward_1): Likewise.
* reload.c (can_reload_into, push_reload, decompose, immune_p,
find_reloads, find_reloads_address, find_reloads_address_1,
reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p,
find_equiv_reg): Likewise.
* reload1.c (reload, eliminate_regs, eliminate_regs_in_insn,
reload_as_needed, choose_reload_regs, emit_input_reload_insns,
do_input_reload, emit_reload_insns, gen_reload, delete_output_reload,
delete_address_reloads): Likewise.
* resource.c (mark_referenced_resources): Likewise.
* rtlanal.c (get_jump_table_offset, count_occurrences,
reg_referenced_p, reg_set_p, set_of_1, set_noop_p,
reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
* sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol,
sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms,
sdbout_global_decl): Likewise.
* simplify-rtx.c (simplify_subreg): Likewise.
* stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl,
expand_anon_union_decl, expand_end_case_type): Likewise.
* unroll.c (calculate_giv_inc): Likewise.
* var-tracking.c (stack_adjust_offset_pre_post,
bb_stack_adjust_offset, track_expr_p, count_uses, add_uses,
add_stores, compute_bb_dataflow, vt_get_decl_and_offset,
vt_add_function_parameters): Likewise.
* varasm.c (make_var_volatile, notice_global_symbol,
assemble_external, decode_addr_const, mark_weak,
default_encode_section_info): Likewise.
From-SVN: r83980
2004-07-01 14:52:53 +02:00
|
|
|
|
else if (MEM_P (recog_data.operand[i]))
|
2005-12-23 10:43:36 +01:00
|
|
|
|
replaced[i] = replace_oldest_value_mem (recog_data.operand[i],
|
|
|
|
|
insn, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
alias.c (get_alias_set, [...]): Use MEM_P.
2004-07-01 Jerry Quinn <jlquinn@optonline.net>
* alias.c (get_alias_set, canon_rtx, get_addr,
nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1):
Use MEM_P.
* builtins.c (expand_builtin_prefetch, expand_builtin_profile_func,
expand_builtin): Likewise.
* calls.c (expand_call, emit_library_call_value_1, store_one_arg):
Likewise.
* combine.c (can_combine_p, combinable_i3pat, try_combine,
find_split_point, combine_simplify_rtx, simplify_set, make_extraction,
rtx_equal_for_field_assignment_p, gen_lowpart_for_combine,
record_dead_and_set_regs_1, get_last_value_validate,
mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise.
* cse.c (check_dependence, canon_hash, equiv_constant,
gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers,
cse_around_loop, cse_check_loop_start, cse_set_around_loop,
count_reg_usage): Likewise.
* cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup,
cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set,
cselib_record_sets): Likewise.
* dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol,
dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise.
* ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise.
* df.c (df_uses_record): Likewise.
* dojump (do_jump): Likewise.
* dwarf2out.c (stack_adjust_offset, mem_loc_descriptor,
loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info,
decl_start_label): Likewise.
* emit-rtl.c (gen_complex_constant_part, gen_highpart,
operand_subword, change_address_1, make_safe_from): Likewise.
* explow.c (break_out_memory_refs, copy_all_regs, validize_mem,
stabilize, force_not_mem): Likewise.
* expmed.c (store_bit_field, store_split_bit_field, extract_bit_field,
expand_mult_const, expand_divmod, emit_store_flag): Likewise.
* expr.c (convert_move, convert_modes, emit_block_move,
emit_group_load, emit_group_store, clear_storage, emit_move_insn,
emit_move_insn_1, expand_assignment, store_expr,
store_constructor_field, store_constructor, store_field,
force_operand, safe_from_p, expand_expr_real_1, expand_increment):
Likewise.
* final.c (cleanup_subreg_operands, alter_subreg,
get_mem_expr_from_op): Likewise.
* flow.c (notice_stack_pointer_modification_1,
init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs):
Likewise.
* function.c (mark_temp_addr_taken, preserve_temp_slots,
preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1,
optimize_bit_field, flush_addressof, purge_addressof_1,
instantiate_decl, instantiate_virtual_regs_1, assign_parms,
setjmp_protect, setjmp_protect_args, fix_lexical_addr,
keep_stack_depressed): Likewise.
* ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok,
noce_process_if_block, find_memory): Likewise.
* integrate.c (subst_constants, allocate_initial_values): Likewise.
* local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p,
update_equiv_regs): Likewise.
* loop.c (scan_loop, prescan_loop, note_addr_stored, check_store,
maybe_eliminate_biv_1, find_mem_in_note_1): Likewise.
* optabs.c (expand_abs, emit_unop_insn): Likewise.
* passes.c (rest_of_handle_final): Likewise.
* postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands,
move2add_note_store): Likewise.
* ra-build.c (detect_remat_webs): Likewise.
* ra-debug.c (dump_static_insn_cost): Likewise.
* ra-rewrite.c (slots_overlap_p, insert_stores): Likewise.
* recog.c (validate_change, apply_change_group, cancel_changes,
validate_replace_rtx_1, general_operand, register_operand,
nonmemory_operand, push_operand, pop_operand, memory_operand,
indirect_operand, asm_operand_ok, offsettable_memref_p,
offsettable_nonstrict_memref_p, constrain_operands,
store_data_bypass_p): Likewise.
* reg-stack.c (subst_stack_regs_pat): Likewise.
* regclass.c (record_operand_costs, scan_one_insn, record_reg_classes,
copy_cost, reg_scan_mark_refs): Likewise.
* regmove.c (optimize_reg_copy_3, stack_memref_p,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (copyprop_hardreg_forward_1): Likewise.
* reload.c (can_reload_into, push_reload, decompose, immune_p,
find_reloads, find_reloads_address, find_reloads_address_1,
reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p,
find_equiv_reg): Likewise.
* reload1.c (reload, eliminate_regs, eliminate_regs_in_insn,
reload_as_needed, choose_reload_regs, emit_input_reload_insns,
do_input_reload, emit_reload_insns, gen_reload, delete_output_reload,
delete_address_reloads): Likewise.
* resource.c (mark_referenced_resources): Likewise.
* rtlanal.c (get_jump_table_offset, count_occurrences,
reg_referenced_p, reg_set_p, set_of_1, set_noop_p,
reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1,
num_sign_bit_copies1): Likewise.
* rtlhooks.c (gen_lowpart_general): Likewise.
* sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise.
* sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol,
sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms,
sdbout_global_decl): Likewise.
* simplify-rtx.c (simplify_subreg): Likewise.
* stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl,
expand_anon_union_decl, expand_end_case_type): Likewise.
* unroll.c (calculate_giv_inc): Likewise.
* var-tracking.c (stack_adjust_offset_pre_post,
bb_stack_adjust_offset, track_expr_p, count_uses, add_uses,
add_stores, compute_bb_dataflow, vt_get_decl_and_offset,
vt_add_function_parameters): Likewise.
* varasm.c (make_var_volatile, notice_global_symbol,
assemble_external, decode_addr_const, mark_weak,
default_encode_section_info): Likewise.
From-SVN: r83980
2004-07-01 14:52:53 +02:00
|
|
|
|
else if (MEM_P (recog_data.operand[i]))
|
2005-12-23 10:43:36 +01:00
|
|
|
|
replaced[i] = replace_oldest_value_mem (recog_data.operand[i],
|
|
|
|
|
insn, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
/* If we performed any replacement, update match_dups. */
|
2005-12-23 10:43:36 +01:00
|
|
|
|
if (replaced[i])
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
int j;
|
|
|
|
|
rtx new;
|
|
|
|
|
|
|
|
|
|
new = *recog_data.operand_loc[i];
|
|
|
|
|
recog_data.operand[i] = new;
|
|
|
|
|
for (j = 0; j < recog_data.n_dups; j++)
|
|
|
|
|
if (recog_data.dup_num[j] == i)
|
2005-12-23 10:43:36 +01:00
|
|
|
|
validate_change (insn, recog_data.dup_loc[j], new, 1);
|
|
|
|
|
|
|
|
|
|
any_replacements = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (any_replacements)
|
|
|
|
|
{
|
|
|
|
|
if (! apply_change_group ())
|
|
|
|
|
{
|
|
|
|
|
for (i = 0; i < n_ops; i++)
|
|
|
|
|
if (replaced[i])
|
|
|
|
|
{
|
|
|
|
|
rtx old = *recog_data.operand_loc[i];
|
|
|
|
|
recog_data.operand[i] = old;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (dump_file)
|
|
|
|
|
fprintf (dump_file,
|
|
|
|
|
"insn %u: reg replacements not verified\n",
|
|
|
|
|
INSN_UID (insn));
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
2005-12-23 10:43:36 +01:00
|
|
|
|
else
|
|
|
|
|
changed = true;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
did_replacement:
|
|
|
|
|
/* Clobber call-clobbered registers. */
|
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
2004-07-08 Jerry Quinn <jlquinn@optonline.net>
* alias.c (nonlocal_mentioned_p, nonlocal_referenced_p,
nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P,
NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P.
* bb-reorder.c (mark_bb_for_unlikely_executed_section,
add_labels_and_missing_jumps, find_jump_block,
fix_crossing_unconditional_branches, add_reg_crossing_jump_notes):
Likewise.
* bt-load.c (btr_referenced_p, compute_defs_uses_and_gen,
link_btr_uses, move_btr_def): Likewise.
* builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto,
expand_builtin_expect_jump): Likewise.
* caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise.
* calls.c (expand_call, emit_library_call_value_1): Likewise.
* cfganal.c (forwarder_block_p): Likewise.
* cfgbuild.c (inside_basic_block_p, count_basic_blocks,
make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1,
find_bb_boundaries): Likewise.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, insns_match_p,
flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge,
try_optimize_cfg): Likewise.
* cfgexpand.c (expand_block, construct_exit_block): Likewise.
* cfglayout.c (skip_insns_after_block, label_for_bb,
record_effective_endpoints, insn_locators_initialize,
fixup_reorder_chain, update_unlikely_executed_notes): Likewise.
* cfgmainloop.c (create_loop_notes): Likewise.
* cfgrtl.c (delete_insn, delete_insn_chain,
create_basic_block_structure, rtl_delete_block, free_bb_for_insn,
update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_branch_edge, force_nonfallthru_and_redirect,
rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p,
rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb,
update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info,
purge_dead_edges, cfg_layout_redirect_edge_and_branch,
cfg_layout_delete_block, cfg_layout_can_merge_blocks_p,
cfg_layout_merge_blocks, rtl_block_ends_with_call_p,
need_fake_edge_p, rtl_flow_call_edges_add): Likewise.
* combine.c (combine_instructions, can_combine_p, try_combine,
find_split_point, record_dead_and_set_regs, reg_dead_at_p,
distribute_notes, distribute_links, insn_cuid): Likewise.
* cse.c (fold_rtx, cse_insn, cse_around_loop,
invalidate_skipped_block, cse_set_around_loop,
cse_end_of_basic_block, cse_main, cse_basic_block,
cse_condition_code_reg): Likewise.
* cselib.c (cselib_process_insn): Likewise.
* ddg.c (create_ddg): Likewise.
* df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify):
Likewise.
* dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug,
gen_label_die, dwarf2out_var_location): Likewise.
* emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn,
next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn,
last_call_insn, active_insn_p, next_label, prev_label,
link_cc0_insns, next_cc0_user, try_split, add_insn_after,
add_insn_before, remove_insn, add_function_usage_to,
reorder_insns, find_line_note, remove_unnecessary_notes,
emit_insn_after_1, classify_insn): Likewise.
* except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before,
connect_post_landing_pads, sjlj_mark_call_sites,
sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers,
can_throw_internal, can_throw_external, set_nothrow_function_flags,
convert_to_eh_region_ranges): Likewise.
* explow.c (optimize_save_area_alloca): Likewise.
* expr.c (expand_expr_real): Likewise.
* final.c (insn_current_reference_address, compute_alignments,
shorten_branches, final, scan_ahead_for_unlikely_executed_note,
final_scan_insn, output_asm_label, leaf_function_p): Likewise.
* flow.c (first_insn_after_basic_block_note, delete_dead_jumptables,
propagate_block_delete_insn, propagate_one_insn,
init_propagate_block_info, propagate_block, libcall_dead_p,
mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment):
Likewise.
* function.c (instantiate_virtual_regs, reorder_blocks_1,
expand_function_start, expand_function_end, contains,
thread_prologue_and_epilogue_insns,
reposition_prologue_and_epilogue_notes): Likewise.
* gcse.c (constprop_register, bypass_conditional_jumps,
insert_insn_end_bb, gcse_after_reload): Likewise.
* genemit.c (gen_expand, gen_split): Likewise.
* genpeep.c (gen_peephole, main): Likewise.
* global.c (build_insn_chain): Likewise.
* graph.c (node_data, print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (unlink_other_notes, unlink_line_notes,
get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes,
restore_line_notes, rm_redundant_line_notes, rm_other_notes,
ok_for_early_queue_removal, set_priorities, sched_init): Likewise.
* ifcvt.c (count_bb_insns, first_active_insn, last_active_insn,
cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block,
merge_if_block, block_jumps_and_fallthru_p, find_if_block,
dead_or_predicable): Likewise.
* integrate.c (try_constants): Likewise.
* jump.c (rebuild_jump_labels, cleanup_barriers,
purge_line_number_notes, init_label_info, mark_all_labels,
squeeze_notes, get_label_before, get_label_after,
reversed_comparison_code_parts, simplejump_p, pc_set,
returnjump_p, onlyjump_p, follow_jumps, mark_jump_label,
delete_barrier, delete_prior_computation, delete_computation,
delete_related_insns, delete_for_peephole, redirect_jump):
Likewise.
* lcm.c (optimize_mode_switching): Likewise.
* local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc):
Likewise.
* loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise.
* loop-invariant.c (find_exits, find_invariants_bb): Likewise.
* loop-iv.c (simplify_using_assignment): Likewise.
* loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg,
libcall_benefit, skip_consec_insns, move_movables, prescan_loop,
find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop,
loop_bivs_init_find, strength_reduce, check_insn_for_bivs,
check_insn_for_givs, check_final_value, update_giv_derive,
basic_induction_var, product_cheap_p, check_dbra_loop,
loop_insn_first_p, last_use_this_basic_block,
canonicalize_condition, get_condition, loop_regs_scan, load_mems,
try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise.
* modulo-sched.c (doloop_register_get, find_line_note, sms_schedule,
sms_schedule_by_order): Likewise.
* optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise.
* postreload.c (reload_cse_simplify_operands, reload_combine,
reload_cse_move2add): Likewise.
* predict.c (can_predict_insn_p, estimate_probability,
expected_value_to_br_prob, process_note_predictions): Likewise.
* print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise.
* profile.c (branch_prob): Likewise.
* ra-build.c (live_out_1, livethrough_conflicts_bb,
detect_webs_set_in_cond_jump): Likewise.
* ra-debug.c (ra_print_rtx_object, ra_debug_insns,
ra_print_rtl_with_bb): Likewise.
* ra-rewrite.c (insert_stores, rewrite_program2): Likewise.
* recog.c (next_insn_tests_no_inequality, find_single_use,
split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise.
* reg-stack.c (next_flags_user, record_label_references,
emit_swap_insn, swap_rtx_condition, subst_stack_regs,
compensate_edge, convert_regs_1): Likewise.
* regclass.c (scan_one_insn): Likewise.
* regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2,
regmove_optimize, fixup_match_1, single_set_for_csa,
combine_stack_adjustments_for_block): Likewise.
* regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise.
* reload.c (find_reloads, find_reloads_address_1, subst_reloads,
find_equiv_reg): Likewise.
* reload1.c (reload, calculate_needs_all_insns, set_label_offsets,
reload_as_needed, emit_input_reload_insns, do_output_reload,
delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges):
Likewise.
* reorg.c (find_end_label, emit_delay_sequence,
delete_from_delay_slot, delete_scheduled_jump, optimize_skip,
get_jump_flags, rare_destination, mostly_true_jump,
try_merge_delay_insns, redundant_insn, own_thread_p,
fill_simple_delay_slots, fill_slots_from_thread,
fill_eager_delay_slots, relax_delay_slots, make_return_insns,
dbr_schedule): Likewise.
* resource.c (find_basic_block, next_insn_no_annul,
find_dead_or_set_registers, mark_target_live_regs): Likewise.
* rtl.h (RTX_PREV): Likewise.
* rtlanal.c (global_reg_mentioned_p, no_labels_between_p,
no_jumps_between_p, reg_used_between_p, reg_referenced_between_p,
reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage,
find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1,
tablejump_p, computed_jump_p, insns_safe_to_move_p,
find_first_parameter_load, can_hoist_insn_p): Likewise.
* sched-deps.c (get_condition, add_dependence, sched_analyze_2,
sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise.
* sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns,
schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, find_conditional_protection,
is_conditionally_protected, can_schedule_ready_p,
add_branch_dependences, debug_dependencies): Likewise.
* stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable):
Likewise.
* unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p,
reg_dead_after_loop, loop_find_equiv_value, loop_iterations,
set_dominates_use, ujump_to_loop_cont): Likewise.
* var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise.
* varasm.c (output_constant_pool_1): Likewise.
From-SVN: r84341
2004-07-09 05:29:35 +02:00
|
|
|
|
if (CALL_P (insn))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
|
|
|
|
if (TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
|
2004-08-20 18:53:49 +02:00
|
|
|
|
kill_value_regno (i, 1, vd);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
|
|
|
|
/* Notice stores. */
|
|
|
|
|
note_stores (PATTERN (insn), kill_set_value, vd);
|
|
|
|
|
|
|
|
|
|
/* Notice copies. */
|
|
|
|
|
if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set)))
|
|
|
|
|
copy_value (SET_DEST (set), SET_SRC (set), vd);
|
|
|
|
|
|
basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
* basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
(BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
(basic_block_def): Rename `head' to `head_' and `end' to `end_'.
(BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
fields of a basic block.
* bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
final.c, flow.c, function.c, gcse.c, global.c, graph.c,
haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
accessing the `head' and `end' fields of a basic block directly.
* gengtype.c: Add missing piece from earlier patch. Dunno what
I was thinking...
From-SVN: r74520
2003-12-11 01:20:51 +01:00
|
|
|
|
if (insn == BB_END (bb))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return changed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Main entry point for the forward copy propagation optimization. */
|
|
|
|
|
|
2006-01-18 16:05:35 +01:00
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
copyprop_hardreg_forward (void)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
struct value_data *all_vd;
|
2004-11-22 16:18:50 +01:00
|
|
|
|
basic_block bb;
|
2005-01-17 23:02:28 +01:00
|
|
|
|
sbitmap visited;
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
2006-01-31 20:56:55 +01:00
|
|
|
|
all_vd = XNEWVEC (struct value_data, last_basic_block);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
basic-block.h: Changed basic block numbering so that the entry block is 0 and the exit block is 1.
2005-12-17 Danny Berlin <dberlin@dberlin.org>
Kenneth Zadeck <zadeck@naturalbridge.com>
* basic-block.h: Changed basic block numbering so that the entry
block is 0 and the exit block is 1. Changed insn iterators so
that they are tolerant of blocks with no insns.
* regrename.c (copyprop_hardreg_forward): Changed basic block
numbering so that the entry block is 0 and the exit block is 1.
* sched-ebb.c (sehedule_ebbs): Ditto.
* tracer.c (branch_ratio_cutoff): Ditto.
* cfgloopmanip.c (fix_loop_structure): Ditto.
* cfghooks.c (verify_flow_info): Ditto.
* cfg.c (compact_blocks): Ditto.
* reorg.c (dbr_schedule): Ditto.
* flow.c (calculate_global_regs_live, libcall_dead_p): Ditto.
* dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree,
calculate_dominance_info): Ditto.
* cfganal.c (create_edge_list, print_edge_list,
flow_depth_first_order_compute, flow_dfs_compute_reverse_init,
flow_dfs_compute_reverse_add_bb, flow_dfs_compute_reverse_execute,
dfs_enumerate_from): Ditto.
* global.c (global_alloc, set_up_bb_rts_numbers): Ditto.
* ifcvt.c (find_if_case_2): Ditto.
* cfgbuild.c (control_flow_insn_p, count_basic_blocks,
find_basic_blocks): Ditto.
* predict.c (predict_loops, tree_bb_level_predictions,
predict_paths_leading_to, propagate_freq): Ditto.
* lcm.c (compute_antinout_edge, compute_laterin,
compute_available): Ditto.
* function.c (thread_prologue_and_epilogue_insns): Ditto.
* gcse.c (gcse_main, bypass_jumps): Ditto.
* profile.c (compute_branch_probabilities,
compute_value_histograms, branch_prob): Ditto.
* tree-flow-inline.h (bsi_start, bsi_after_labels,
bsi_last): Ditto.
* tree-ssa-phiopt.c (tree_ssa_phiopt,
blocks_in_phiopt_order): Ditto.
* bt-load.c (compute_defs_uses_and_gen, compute_kill,
compute_out, link_btr_uses, migrate_btr_defs): Ditto.
* tree-dfa.c (collect_dfa_stats): Ditto.
* cfgcleanup.c (try_forward_edges, try_optimize_cfg): Ditto.
* cfglayout.c (fixup_reorder_chain): Ditto.
* bb-reorder.c (reorder_basic_blocks, duplicate_computed_gotos,
partition_hot_cold_basic_blocks): Ditto.
* var-tracking.c (vt_find_locations): Ditto.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find, get_loop_body): Ditto.
* sched-rgn.c (compute_trg_info, init_regions, schedule_insns): Ditto.
* tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, make_edges
label_to_block_fn, print_loop_ir, tree_flow_call_edges_add): Ditto.
* tree-ssa-reassoc.c (init_reassoc): Ditto.
* cfgrtl.c (entry_of_function, rtl_verify_flow_info,
rtl_flow_call_edges_add, rtl_flow_call_edges_add): Ditto.
* df.c (df_analyze_1, hybrid_search, iterative_dataflow): Ditto
and removed unused reverse orders.
* df.h (): Ditto.
* combine.c: Fix document typo.
Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>
From-SVN: r108713
2005-12-17 14:40:27 +01:00
|
|
|
|
visited = sbitmap_alloc (last_basic_block);
|
2005-01-17 23:02:28 +01:00
|
|
|
|
sbitmap_zero (visited);
|
2004-11-22 16:18:50 +01:00
|
|
|
|
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
FOR_EACH_BB (bb)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
basic-block.h: Changed basic block numbering so that the entry block is 0 and the exit block is 1.
2005-12-17 Danny Berlin <dberlin@dberlin.org>
Kenneth Zadeck <zadeck@naturalbridge.com>
* basic-block.h: Changed basic block numbering so that the entry
block is 0 and the exit block is 1. Changed insn iterators so
that they are tolerant of blocks with no insns.
* regrename.c (copyprop_hardreg_forward): Changed basic block
numbering so that the entry block is 0 and the exit block is 1.
* sched-ebb.c (sehedule_ebbs): Ditto.
* tracer.c (branch_ratio_cutoff): Ditto.
* cfgloopmanip.c (fix_loop_structure): Ditto.
* cfghooks.c (verify_flow_info): Ditto.
* cfg.c (compact_blocks): Ditto.
* reorg.c (dbr_schedule): Ditto.
* flow.c (calculate_global_regs_live, libcall_dead_p): Ditto.
* dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree,
calculate_dominance_info): Ditto.
* cfganal.c (create_edge_list, print_edge_list,
flow_depth_first_order_compute, flow_dfs_compute_reverse_init,
flow_dfs_compute_reverse_add_bb, flow_dfs_compute_reverse_execute,
dfs_enumerate_from): Ditto.
* global.c (global_alloc, set_up_bb_rts_numbers): Ditto.
* ifcvt.c (find_if_case_2): Ditto.
* cfgbuild.c (control_flow_insn_p, count_basic_blocks,
find_basic_blocks): Ditto.
* predict.c (predict_loops, tree_bb_level_predictions,
predict_paths_leading_to, propagate_freq): Ditto.
* lcm.c (compute_antinout_edge, compute_laterin,
compute_available): Ditto.
* function.c (thread_prologue_and_epilogue_insns): Ditto.
* gcse.c (gcse_main, bypass_jumps): Ditto.
* profile.c (compute_branch_probabilities,
compute_value_histograms, branch_prob): Ditto.
* tree-flow-inline.h (bsi_start, bsi_after_labels,
bsi_last): Ditto.
* tree-ssa-phiopt.c (tree_ssa_phiopt,
blocks_in_phiopt_order): Ditto.
* bt-load.c (compute_defs_uses_and_gen, compute_kill,
compute_out, link_btr_uses, migrate_btr_defs): Ditto.
* tree-dfa.c (collect_dfa_stats): Ditto.
* cfgcleanup.c (try_forward_edges, try_optimize_cfg): Ditto.
* cfglayout.c (fixup_reorder_chain): Ditto.
* bb-reorder.c (reorder_basic_blocks, duplicate_computed_gotos,
partition_hot_cold_basic_blocks): Ditto.
* var-tracking.c (vt_find_locations): Ditto.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find, get_loop_body): Ditto.
* sched-rgn.c (compute_trg_info, init_regions, schedule_insns): Ditto.
* tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, make_edges
label_to_block_fn, print_loop_ir, tree_flow_call_edges_add): Ditto.
* tree-ssa-reassoc.c (init_reassoc): Ditto.
* cfgrtl.c (entry_of_function, rtl_verify_flow_info,
rtl_flow_call_edges_add, rtl_flow_call_edges_add): Ditto.
* df.c (df_analyze_1, hybrid_search, iterative_dataflow): Ditto
and removed unused reverse orders.
* df.h (): Ditto.
* combine.c: Fix document typo.
Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>
From-SVN: r108713
2005-12-17 14:40:27 +01:00
|
|
|
|
SET_BIT (visited, bb->index);
|
2004-11-22 16:18:50 +01:00
|
|
|
|
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
/* If a block has a single predecessor, that we've already
|
|
|
|
|
processed, begin with the value data that was live at
|
|
|
|
|
the end of the predecessor block. */
|
2003-11-21 07:52:23 +01:00
|
|
|
|
/* ??? Ought to use more intelligent queuing of blocks. */
|
basic-block.h: Changed basic block numbering so that the entry block is 0 and the exit block is 1.
2005-12-17 Danny Berlin <dberlin@dberlin.org>
Kenneth Zadeck <zadeck@naturalbridge.com>
* basic-block.h: Changed basic block numbering so that the entry
block is 0 and the exit block is 1. Changed insn iterators so
that they are tolerant of blocks with no insns.
* regrename.c (copyprop_hardreg_forward): Changed basic block
numbering so that the entry block is 0 and the exit block is 1.
* sched-ebb.c (sehedule_ebbs): Ditto.
* tracer.c (branch_ratio_cutoff): Ditto.
* cfgloopmanip.c (fix_loop_structure): Ditto.
* cfghooks.c (verify_flow_info): Ditto.
* cfg.c (compact_blocks): Ditto.
* reorg.c (dbr_schedule): Ditto.
* flow.c (calculate_global_regs_live, libcall_dead_p): Ditto.
* dominance.c (calc_dfs_tree_nonrec, calc_dfs_tree,
calculate_dominance_info): Ditto.
* cfganal.c (create_edge_list, print_edge_list,
flow_depth_first_order_compute, flow_dfs_compute_reverse_init,
flow_dfs_compute_reverse_add_bb, flow_dfs_compute_reverse_execute,
dfs_enumerate_from): Ditto.
* global.c (global_alloc, set_up_bb_rts_numbers): Ditto.
* ifcvt.c (find_if_case_2): Ditto.
* cfgbuild.c (control_flow_insn_p, count_basic_blocks,
find_basic_blocks): Ditto.
* predict.c (predict_loops, tree_bb_level_predictions,
predict_paths_leading_to, propagate_freq): Ditto.
* lcm.c (compute_antinout_edge, compute_laterin,
compute_available): Ditto.
* function.c (thread_prologue_and_epilogue_insns): Ditto.
* gcse.c (gcse_main, bypass_jumps): Ditto.
* profile.c (compute_branch_probabilities,
compute_value_histograms, branch_prob): Ditto.
* tree-flow-inline.h (bsi_start, bsi_after_labels,
bsi_last): Ditto.
* tree-ssa-phiopt.c (tree_ssa_phiopt,
blocks_in_phiopt_order): Ditto.
* bt-load.c (compute_defs_uses_and_gen, compute_kill,
compute_out, link_btr_uses, migrate_btr_defs): Ditto.
* tree-dfa.c (collect_dfa_stats): Ditto.
* cfgcleanup.c (try_forward_edges, try_optimize_cfg): Ditto.
* cfglayout.c (fixup_reorder_chain): Ditto.
* bb-reorder.c (reorder_basic_blocks, duplicate_computed_gotos,
partition_hot_cold_basic_blocks): Ditto.
* var-tracking.c (vt_find_locations): Ditto.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find, get_loop_body): Ditto.
* sched-rgn.c (compute_trg_info, init_regions, schedule_insns): Ditto.
* tree-cfg.c (init_empty_tree_cfg, build_tree_cfg, make_edges
label_to_block_fn, print_loop_ir, tree_flow_call_edges_add): Ditto.
* tree-ssa-reassoc.c (init_reassoc): Ditto.
* cfgrtl.c (entry_of_function, rtl_verify_flow_info,
rtl_flow_call_edges_add, rtl_flow_call_edges_add): Ditto.
* df.c (df_analyze_1, hybrid_search, iterative_dataflow): Ditto
and removed unused reverse orders.
* df.h (): Ditto.
* combine.c: Fix document typo.
Co-Authored-By: Kenneth Zadeck <zadeck@naturalbridge.com>
From-SVN: r108713
2005-12-17 14:40:27 +01:00
|
|
|
|
if (single_pred_p (bb)
|
|
|
|
|
&& TEST_BIT (visited, single_pred (bb)->index)
|
basic-block.h (single_succ_p, [...]): New inline functions.
* basic-block.h (single_succ_p, single_pred_p, single_succ_edge,
single_pred_edge, single_succ, single_pred): New inline functions.
* bb-reorder.c (rotate_loop, find_traces_1_round,
add_labels_and_missing_jumps, fix_up_fall_thru_edges,
duplicate_computed_gotos): Use the single_succ/pred functions.
* cfganal.c (forwarder_block_p): Ditto.
* cfgbuild.c (compute_outgoing_frequencies): Ditto.
* cfgcleanup.c (try_simplify_condjump, try_forward_edges,
outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg,
merge_seq_blocks): Ditto.
* cfghooks.c (split_edge, tidy_fallthru_edges): Ditto.
* cfglayout.c (fixup_reorder_chain): Ditto.
* cfgloop.c (mark_single_exit_loops, update_latch_info,
canonicalize_loop_headers, verify_loop_structure): Ditto.
* cfgloopmanip.c (remove_path, unloop, loop_delete_branch_edge,
mfb_update_loops, create_preheader, force_single_succ_latches,
create_loop_notes): Ditto.
* cfgrtl.c (rtl_can_merge_blocks, try_redirect_by_replacing_jump,
force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge,
commit_one_edge_insertion, purge_dead_edges,
cfg_layout_can_merge_blocks_p): Ditto.
* except.c (sjlj_emit_function_enter): Ditto.
* flow.c (init_propagate_block_info): Ditto.
* function.c (thread_prologue_and_epilogue_insns): Ditto.
* gcse.c (find_implicit_sets, bypass_conditional_jumps,
insert_insn_end_bb): Ditto.
* ifcvt.c (merge_if_block, find_if_block, find_if_case_1,
find_if_case_2): Ditto.
* lambda-code.c (perfect_nestify): Ditto.
* lcm.c (optimize_mode_switching): Ditto.
* loop-doloop.c (doloop_modify): Ditto.
* loop-init.c (loop_optimizer_init): Ditto.
* loop-iv.c (simplify_using_initial_values): Ditto.
* loop-unroll.c (unroll_loop_runtime_iterations): Ditto.
* loop-unswitch.c (unswitch_loop): Ditto.
* modulo-sched.c (generate_prolog_epilog): Ditto.
* predict.c (combine_predictions_for_insn, estimate_probability,
tree_estimate_probability, last_basic_block_p,
estimate_bb_frequencies): Ditto.
* profile.c (branch_prob): Ditto.
* regrename.c (copyprop_hardreg_forward): Ditto.
* sched-rgn.c (is_cfg_nonregular, find_rgns, update_live): Ditto.
* tracer.c (layout_superblocks): Ditto.
* tree-cfg.c (tree_can_merge_blocks_p, tree_merge_blocks,
cfg_remove_useless_stmts_bb, cleanup_control_flow,
cleanup_control_expr_graph, disband_implicit_edges,
tree_find_edge_insert_loc, bsi_commit_edge_inserts,
tree_verify_flow_info, tree_make_forwarder_block,
tree_forwarder_block_p, remove_forwarder_block,
remove_forwarder_block_with_phi, merge_phi_nodes): Ditto.
* tree-if-conv.c (tree_if_conversion): Ditto.
* tree-mudflap.c (mf_build_check_statement_for): Ditto.
* tree-ssa-dce.c (remove_dead_stmt): Ditto.
* tree-ssa-dom.c (dom_opt_finalize_block): Ditto.
* tree-ssa-loop-ch.c (should_duplicate_loop_header_p,
copy_loop_headers): Ditto.
* tree-ssa-loop-im.c (loop_commit_inserts): Ditto.
* tree-ssa-loop-ivopts.c (compute_phi_arg_on_exit): Ditto.
* tree-ssa-loop-manip.c (split_loop_exit_edge, ip_normal_pos,
lv_adjust_loop_entry_edge, tree_ssa_loop_version): Ditto.
* tree-ssa-loop-niter.c (simplify_using_initial_conditions): Ditto.
* tree-ssa-loop-unswitch.c (simplify_using_entry_checks): Ditto.
* tree-ssa-phiopt.c (tree_ssa_phiopt, value_replacement): Ditto.
* tree-ssa-pre.c (compute_antic_aux, insert_aux, init_pre): Ditto.
* tree-ssa-threadupdate.c (redirect_edges): Ditto.
* tree-tailcall.c (independent_of_stmt_p, find_tail_calls,
eliminate_tail_call, tree_optimize_tail_calls_1): Ditto.
* tree-vect-analyze.c (vect_analyze_loop_form): Ditto.
* tree-vect-transform.c (vect_update_ivs_after_vectorizer): Ditto.
* tree-vectorizer.c (slpeel_update_phi_nodes_for_guard,
slpeel_add_loop_guard): Ditto.
From-SVN: r96292
2005-03-11 10:05:12 +01:00
|
|
|
|
&& ! (single_pred_edge (bb)->flags & (EDGE_ABNORMAL_CALL | EDGE_EH)))
|
|
|
|
|
all_vd[bb->index] = all_vd[single_pred (bb)->index];
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
else
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
init_value_data (all_vd + bb->index);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
|
2007-06-11 20:02:15 +02:00
|
|
|
|
copyprop_hardreg_forward_1 (bb, all_vd + bb->index);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
}
|
|
|
|
|
|
2005-01-17 23:02:28 +01:00
|
|
|
|
sbitmap_free (visited);
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
free (all_vd);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Dump the value chain data to stderr. */
|
|
|
|
|
|
|
|
|
|
void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
debug_value_data (struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
HARD_REG_SET set;
|
|
|
|
|
unsigned int i, j;
|
|
|
|
|
|
|
|
|
|
CLEAR_HARD_REG_SET (set);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
|
|
|
|
|
if (vd->e[i].oldest_regno == i)
|
|
|
|
|
{
|
|
|
|
|
if (vd->e[i].mode == VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
if (vd->e[i].next_regno != INVALID_REGNUM)
|
|
|
|
|
fprintf (stderr, "[%u] Bad next_regno for empty chain (%u)\n",
|
|
|
|
|
i, vd->e[i].next_regno);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SET_HARD_REG_BIT (set, i);
|
|
|
|
|
fprintf (stderr, "[%u %s] ", i, GET_MODE_NAME (vd->e[i].mode));
|
|
|
|
|
|
|
|
|
|
for (j = vd->e[i].next_regno;
|
|
|
|
|
j != INVALID_REGNUM;
|
|
|
|
|
j = vd->e[j].next_regno)
|
|
|
|
|
{
|
2002-01-08 07:13:34 +01:00
|
|
|
|
if (TEST_HARD_REG_BIT (set, j))
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
fprintf (stderr, "[%u] Loop in regno chain\n", j);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (vd->e[j].oldest_regno != i)
|
|
|
|
|
{
|
|
|
|
|
fprintf (stderr, "[%u] Bad oldest_regno (%u)\n",
|
|
|
|
|
j, vd->e[j].oldest_regno);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
SET_HARD_REG_BIT (set, j);
|
|
|
|
|
fprintf (stderr, "[%u %s] ", j, GET_MODE_NAME (vd->e[j].mode));
|
|
|
|
|
}
|
|
|
|
|
fputc ('\n', stderr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
|
|
|
|
|
if (! TEST_HARD_REG_BIT (set, i)
|
|
|
|
|
&& (vd->e[i].mode != VOIDmode
|
|
|
|
|
|| vd->e[i].oldest_regno != i
|
|
|
|
|
|| vd->e[i].next_regno != INVALID_REGNUM))
|
|
|
|
|
fprintf (stderr, "[%u] Non-empty reg in chain (%s %u %i)\n",
|
|
|
|
|
i, GET_MODE_NAME (vd->e[i].mode), vd->e[i].oldest_regno,
|
|
|
|
|
vd->e[i].next_regno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
|
static void
|
2003-07-06 11:56:09 +02:00
|
|
|
|
validate_value_data (struct value_data *vd)
|
regrename.c (copyprop_hardreg_forward): New optimization.
* regrename.c (copyprop_hardreg_forward): New optimization.
(kill_value_regno, kill_value, init_value_data, kill_clobbered_value,
kill_set_value, kill_autoinc_value, copy_value, find_oldest_value_reg,
replace_oldest_value_reg, replace_oldest_value_addr,
replace_oldest_value_mem, copyprop_hardreg_forward_1,
debug_value_data, validate_value_data): New.
* rtl.h (copyprop_hardreg_forward): Declare.
* toplev.c (flag_cprop_registers): New.
(f_options): Add -fcprop-registers
(rest_of_compilation): Invoke it.
(parse_options_and_default_flags): Set it at -O1.
* doc/invoke.texi: Document it.
From-SVN: r47951
2001-12-12 23:50:05 +01:00
|
|
|
|
{
|
|
|
|
|
HARD_REG_SET set;
|
|
|
|
|
unsigned int i, j;
|
|
|
|
|
|
|
|
|
|
CLEAR_HARD_REG_SET (set);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
|
|
|
|
|
if (vd->e[i].oldest_regno == i)
|
|
|
|
|
{
|
|
|
|
|
if (vd->e[i].mode == VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
if (vd->e[i].next_regno != INVALID_REGNUM)
|
|
|
|
|
internal_error ("validate_value_data: [%u] Bad next_regno for empty chain (%u)",
|
|
|
|
|
i, vd->e[i].next_regno);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SET_HARD_REG_BIT (set, i);
|
|
|
|
|
|
|
|
|
|
for (j = vd->e[i].next_regno;
|
|
|
|
|
j != INVALID_REGNUM;
|
|
|
|
|
j = vd->e[j].next_regno)
|
|
|
|
|
{
|
|
|
|
|
if (TEST_HARD_REG_BIT (set, j))
|
|
|
|
|
internal_error ("validate_value_data: Loop in regno chain (%u)",
|
|
|
|
|
j);
|
|
|
|
|
if (vd->e[j].oldest_regno != i)
|
|
|
|
|
internal_error ("validate_value_data: [%u] Bad oldest_regno (%u)",
|
|
|
|
|
j, vd->e[j].oldest_regno);
|
|
|
|
|
|
|
|
|
|
SET_HARD_REG_BIT (set, j);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; ++i)
|
|
|
|
|
if (! TEST_HARD_REG_BIT (set, i)
|
|
|
|
|
&& (vd->e[i].mode != VOIDmode
|
|
|
|
|
|| vd->e[i].oldest_regno != i
|
|
|
|
|
|| vd->e[i].next_regno != INVALID_REGNUM))
|
|
|
|
|
internal_error ("validate_value_data: [%u] Non-empty reg in chain (%s %u %i)",
|
|
|
|
|
i, GET_MODE_NAME (vd->e[i].mode), vd->e[i].oldest_regno,
|
|
|
|
|
vd->e[i].next_regno);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
gate_handle_regrename (void)
|
|
|
|
|
{
|
2007-06-11 20:02:15 +02:00
|
|
|
|
return (optimize > 0 && (flag_rename_registers));
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Run the regrename and cprop passes. */
|
2006-03-02 20:00:11 +01:00
|
|
|
|
static unsigned int
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
rest_of_handle_regrename (void)
|
|
|
|
|
{
|
2007-06-11 20:02:15 +02:00
|
|
|
|
regrename_optimize ();
|
2006-03-02 20:00:11 +01:00
|
|
|
|
return 0;
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct tree_opt_pass pass_regrename =
|
|
|
|
|
{
|
|
|
|
|
"rnreg", /* name */
|
|
|
|
|
gate_handle_regrename, /* gate */
|
|
|
|
|
rest_of_handle_regrename, /* execute */
|
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_RENAME_REGISTERS, /* tv_id */
|
|
|
|
|
0, /* properties_required */
|
|
|
|
|
0, /* properties_provided */
|
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
|
0, /* todo_flags_start */
|
2007-06-11 20:02:15 +02:00
|
|
|
|
TODO_df_finish |
|
|
|
|
|
TODO_dump_func, /* todo_flags_finish */
|
|
|
|
|
'n' /* letter */
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static bool
|
|
|
|
|
gate_handle_cprop (void)
|
|
|
|
|
{
|
|
|
|
|
return (optimize > 0 && (flag_cprop_registers));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Run the regrename and cprop passes. */
|
|
|
|
|
static unsigned int
|
|
|
|
|
rest_of_handle_cprop (void)
|
|
|
|
|
{
|
|
|
|
|
copyprop_hardreg_forward ();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct tree_opt_pass pass_cprop_hardreg =
|
|
|
|
|
{
|
|
|
|
|
"cprop_hardreg", /* name */
|
|
|
|
|
gate_handle_cprop, /* gate */
|
|
|
|
|
rest_of_handle_cprop, /* execute */
|
|
|
|
|
NULL, /* sub */
|
|
|
|
|
NULL, /* next */
|
|
|
|
|
0, /* static_pass_number */
|
|
|
|
|
TV_RENAME_REGISTERS, /* tv_id */
|
|
|
|
|
0, /* properties_required */
|
|
|
|
|
0, /* properties_provided */
|
|
|
|
|
0, /* properties_destroyed */
|
|
|
|
|
0, /* todo_flags_start */
|
Makefile.in: Adjust dependencies.
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in: Adjust dependencies.
* tree-pass.h: Add new passes and passes formerly in tree-optimize.c.
* basic-block.h (duplicate_computed_gotos): Remove, it is now static.
* alias.c (rest_of_handle_cfg, pass_cfg): New.
* bb-reorder.c (duplicate_computed_gotos): Make it static.
* cfgexpand.c (tree_expand_cfg): Add code formerly at the beginning of
rest_of_compilation.
* bb-reorder.c (gate_duplicate_computed_gotos,
pass_duplicate_computed_gotos, gate_handle_reorder_blocks,
rest_of_handle_reorder_blocks, pass_reorder_blocks,
gate_handle_partition_blocks, rest_of_handle_partition_blocks,
pass_partition_blocks): New.
* bt-load.c (gate_handle_branch_target_load_optimize,
rest_of_handle_branch_target_load_optimize,
pass_branch_target_load_optimize): New.
* cfgcleanup.c (rest_of_handle_jump, pass_jump, rest_of_handle_jump2,
pass_jump2): New.
* cfglayout.c (pass_insn_locators_initialize): New.
* cfgrtl.c (pass_free_cfg): New.
* combine.c (gate_handle_combine, rest_of_handle_combine,
pass_combine): New.
* cse.c (gate_handle_cse, rest_of_handle_cse, pass_cse,
gate_handle_cse2, rest_of_handle_cse2, pass_cse2): New.
* emit-rtl.c (pass_unshare_all_rtl, pass_remove_unnecessary_notes): New.
* except.c (pass_set_nothrow_function_flags,
pass_convert_to_eh_region_ranges, gate_handle_eh, rest_of_handle_eh,
pass_rtl_eh): New.
* final.c (pass_compute_alignments, rest_of_handle_final, pass_final,
rest_of_handle_shorten_branches, pass_shorten_branches,
rest_of_clean_state, pass_clean_state): New.
* flow.c (pass_recompute_reg_usage, gate_remove_death_notes,
rest_of_handle_remove_death_notes, pass_remove_death_notes,
rest_of_handle_life, pass_life, rest_of_handle_flow2,
pass_flow2): New.
* function.c (pass_instantiate_virtual_regs, pass_init_function,
rest_of_handle_check_leaf_regs, pass_leaf_regs): New.
* gcse.c (gate_handle_jump_bypass, rest_of_handle_jump_bypass,
pass_jump_bypass, gate_handle_gcse, rest_of_handle_gcse,
pass_gcse): New.
* global.c (rest_of_handle_global_alloc, pass_global_alloc): New.
* ifcvt.c (gate_handle_if_conversion, rest_of_handle_if_conversion,
pass_rtl_ifcvt, gate_handle_if_after_combine,
rest_of_handle_if_after_combine, pass_if_after_combine,
gate_handle_if_after_reload, rest_of_handle_if_after_reload,
pass_if_after_reload): New.
* integrate.c (pass_initial_value_sets): New.
* jump.c (pass_cleanup_barriers, purge_line_number_notes,
pass_purge_lineno_notes): New.
* mode-switching.c (rest_of_handle_mode_switching,
pass_mode_switching): New.
* local-alloc.c (rest_of_handle_local_alloc, pass_local_alloc): New.
* loop-init.c (gate_handle_loop2, rest_of_handle_loop2,
pass_loop2): New.
* loop.c (gate_handle_loop_optimize, rest_of_handle_loop_optimize,
pass_loop_optimize): New.
* modulo-sched.c (gate_handle_sms, rest_of_handle_sms,
pass_sms): New.
* postreload-gcse.c (gate_handle_gcse2, rest_of_handle_gcse2,
pass_gcse2): New.
* postreload.c (gate_handle_postreload, rest_of_handle_postreload,
pass_postreload_cse): New.
* profile.c (gate_handle_profiling, pass_profiling,
rest_of_handle_branch_prob, pass_branch_prob): New.
* recog.c (pass pass_split_for_shorten_branches, gate_do_final_split,
pass_split_before_regstack, gate_handle_split_before_regstack,
gate_handle_peephole2, rest_of_handle_peephole2, pass_peephole2,
rest_of_handle_split_all_insns, pass_split_all_insns): New.
* reg-stack.c (gate_handle_stack_regs, rest_of_handle_stack_regs,
pass_stack_regs): New.
* regmove.c (gate_handle_regmove, rest_of_handle_regmove, pass_regmove,
gate_handle_stack_adjustments, rest_of_handle_stack_adjustments,
pass_stack_adjustments): New.
* regrename.c (gate_handle_regrename, rest_of_handle_regrename,
pass_regrename): New.
* reorg.c (gate_handle_delay_slots, rest_of_handle_delay_slots,
pass_delay_slots, gate_handle_machine_reorg,
rest_of_handle_machine_reorg, pass_machine_reorg): New.
* rtl.h (extern void purge_line_number_notes): New.
* sched-rgn.c (gate_handle_sched, rest_of_handle_sched,
gate_handle_sched2, rest_of_handle_sched2, pass_sched,
pass_sched2): New.
* tracer.c (gate_handle_tracer, rest_of_handle_tracer,
pass_tracer): New.
* value-prof.c (gate_handle_value_profile_transformations,
rest_of_handle_value_profile_transformations,
pass_value_profile_transformations): New.
* var-tracking.c (gate_handle_var_tracking,
pass_variable_tracking): New.
* web.c (gate_handle_web, rest_of_handle_web, pass_web): New.
* passes.c (open_dump_file, close_dump_file, rest_of_handle_final,
rest_of_handle_delay_slots, rest_of_handle_stack_regs,
rest_of_handle_variable_tracking, rest_of_handle_machine_reorg,
rest_of_handle_old_regalloc, rest_of_handle_regrename,
rest_of_handle_reorder_blocks, rest_of_handle_partition_blocks,
rest_of_handle_sms, rest_of_handle_sched, rest_of_handle_sched2,
rest_of_handle_gcse2, rest_of_handle_regmove,
rest_of_handle_tracer, rest_of_handle_if_conversion,
rest_of_handle_if_after_combine, rest_of_handle_if_after_reload,
rest_of_handle_web, rest_of_handle_branch_prob,
rest_of_handle_value_profile_transformations, rest_of_handle_cfg,
rest_of_handle_jump_bypass, rest_of_handle_combine,
rest_of_handle_life, rest_of_handle_cse, rest_of_handle_cse2,
rest_of_handle_gcse, rest_of_handle_loop_optimize,
rest_of_handle_loop2, rest_of_handle_branch_target_load_optimize,
rest_of_handle_mode_switching, rest_of_handle_jump,
rest_of_handle_eh, rest_of_handle_stack_adjustments,
rest_of_handle_flow2, rest_of_handle_jump2,
rest_of_handle_peephole2, rest_of_handle_postreload,
rest_of_handle_shorten_branches, rest_of_clean_state,
rest_of_compilation): Remove.
* cgraphunit.c (ipa_passes): Moved from tree-optimize.c.
* passes.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list): Moved
from tree-optimize.c.
(init_optimization_passes): Moved from tree-optimize.c,
adding the RTL optimizations.
* tree-dump.h (dump_info_p, dump_flag): Moved from tree.h.
* tree-optimize.c (dump_flags, in_gimple_form, all_passes,
all_ipa_passes, all_lowering_passes, register_one_dump_file,
register_dump_files, next_pass_1, last_verified, execute_todo,
execute_one_pass, execute_pass_list, execute_ipa_pass_list,
init_tree_optimization_passes, ipa_passes): Delete.
* tree-pass.h (enum tree_dump_index): Moved from tree.h, removing
the RTL dumps.
(TDF_*, get_dump_file_name, dump_enabled_p, dump_initialized_p,
dump_begin, dump_end, dump_node, dump_switch_p, dump_flag_name): Moved
from tree.h.
(ipa_passes): Remove.
(all_passes, all_ipa_passes, all_lowering_passes): Now extern.
* tree.h (enum tree_dump_index, TDF_*, get_dump_file_name,
dump_enabled_p, dump_initialized_p, dump_begin, dump_end, dump_node,
dump_switch_p, dump_flag_name): Moved to tree-pass.h.
(dump_info_p, dump_flag): Moved to tree-dump.h.
* Makefile.in: Adjust dependencies for tree-pretty-print.c,
cgraph.c, opts.c.
* passes.c (finish_optimization_passes): Use dump_begin
and dump_end, TDI_end.
(gate_rest_of_compilation): New.
(pass_rest_of_compilation): Use it.
(gate_postreload, pass_postreload): New.
* toplev.c (general_init): Rename init_tree_optimization_passes.
* toplev.h (init_tree_optimization_passes): Rename to
init_optimizations_passes.
* tree-dump.c (dump_flag): Make static.
(dump_files): Remove RTL dumps.
* tree-optimize.c (pass_all_optimizations, pass_early_local_passes,
pass_cleanup_cfg, pass_free_cfg_annotations,
pass_cleanup_cfg_post_optimizing, pass_free_datastructures,
pass_init_datastructures, pass_fixup_cfg): Make non-static.
* tree-pretty-print.c: Include tree-pass.h.
* cgraph.c: Include tree-dump.h.
cp:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (class.o, decl2.o): Adjust dependencies.
* class.c: Include tree-dump.h.
* decl2.c: Include tree-dump.h.
java:
2005-07-05 Paolo Bonzini <bonzini@gnu.org>
* Makefile.in (parse.o): Adjust dependencies.
* parse.y: Include tree-dump.h.
From-SVN: r101627
2005-07-05 18:20:53 +02:00
|
|
|
|
TODO_dump_func, /* todo_flags_finish */
|
|
|
|
|
'n' /* letter */
|
|
|
|
|
};
|
|
|
|
|
|