2001-06-29 00:11:19 +02:00
|
|
|
/* Form lists of pseudo register references for autoinc optimization
|
2003-06-29 17:19:13 +02:00
|
|
|
for GNU compiler. This is part of flow optimization.
|
2005-02-07 16:53:36 +01:00
|
|
|
Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005
|
|
|
|
Free Software Foundation, Inc.
|
2001-06-29 00:11:19 +02:00
|
|
|
Contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz)
|
|
|
|
|
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.
|
2001-06-29 00:11:19 +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 the Free
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
version.
|
2001-06-29 00:11:19 +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 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.
|
2001-06-29 00:11:19 +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
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
02111-1307, USA. */
|
2001-06-29 00:11:19 +02:00
|
|
|
|
Makefile.in (RA_H, [...]): New.
2004-06-03 Jerry Quinn <jlquinn@optonline.net>
* Makefile.in (RA_H, RESOURCE_H, SCHED_INT_H, CFGLAYOUT_H,
CFGLOOP_H, DF_H, DDG_H, TREE_SSA_LIVE_H): New.
(TARGET_H): Add insn-modes.h.
(tree-ssa.o, tree-cfg.o, tree-ssa-loop.o, toplev.o, passes.o,
loop.o, loop-doloop.o, unroll.o, cfgloop.o, cfgloopanal.o,
loop-iv.o, cfgloopmanip.o, loop-init.o, loop-unswitch.o,
loop-unroll.o, ddg.o, modulo-sched.o, predict.o,
cfglayout.o, ifcvt.o): Replace cfgloop.h with CFGLOOP_H.
(toplev.o, passes.o, cfghooks.o, cfgloopmanip.o, loop-init.o,
loop-unswitch.o, loop-unroll.o, ddg.o, modulo-sched.o,
bb-reorder.o, tracer.o, cfglayout.o): Replace cfglayout.h with
CFGLAYOUT_H.
(ra.o, ra-build.o, ra-colorize.o, ra-debug.o, ra-rewrite.o):
Replace ra.h with RA_H.
(resource.o, regrename.o, insn-conditions.o, insn-emit.o,
insn-recog.o): Replace resource.h with RESOURCE_H.
(ddg.o, modulo-sched.o, haifa-sched.o, sched-deps.o, sched-rgn.o,
sched-ebb.o, sched-vis.o, out_object_file): Replace sched-int.h
with SCHED_INT_H.
(web.o, lcm.o, df.o, ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
ra-rewrite.o): Replace df.h with DF_H.
(ddg.o, modulo-sched.o): Replace ddf.h with DDG_H.
(tree-outof-ssa.o, tree-ssa-live.o, tree-ssa-copyrename.o):
Replace tree-ssa-live.h with TREE_SSA_LIVE_H.
(insn-conditions.o): Remove unused reload.h.
* cfglayout.h: Add include guard. Include basic-block.h.
* cfgloop.h: Add include guard. Include basic-block.h, rtl.h.
* ddg.h: Include sbitmap.h, basic-block.h, df.h.
* df.h: Add include guard. Include bitmap.h, sbitmap.h,
basic-block.h.
* genconditions.c: Remove reload.h.
* ra.h: Add include guard. Include bitmap.h, sbitmap.h,
hard-reg-set.h, insn-modes.h.
* resource.h: Add include guard. Include hard-reg-set.h.
* sched-int.h: Add include guard. Include insn-attr.h,
basic-block.h, rtl.h.
* target.h: Add include guard. Include insn-modes.h.
* tree-ssa-live.h: Include partition.h.
From-SVN: r82600
2004-06-03 17:01:08 +02:00
|
|
|
#ifndef GCC_DF_H
|
|
|
|
#define GCC_DF_H
|
|
|
|
|
|
|
|
#include "bitmap.h"
|
|
|
|
#include "basic-block.h"
|
|
|
|
|
2004-04-04 23:12:35 +02:00
|
|
|
#define DF_RD 1 /* Reaching definitions. */
|
|
|
|
#define DF_RU 2 /* Reaching uses. */
|
|
|
|
#define DF_LR 4 /* Live registers. */
|
|
|
|
#define DF_DU_CHAIN 8 /* Def-use chain. */
|
|
|
|
#define DF_UD_CHAIN 16 /* Use-def chain. */
|
2001-06-29 00:11:19 +02:00
|
|
|
#define DF_REG_INFO 32 /* Register info. */
|
|
|
|
#define DF_RD_CHAIN 64 /* Reg-def chain. */
|
2004-04-04 23:12:35 +02:00
|
|
|
#define DF_RU_CHAIN 128 /* Reg-use chain. */
|
|
|
|
#define DF_ALL 255
|
|
|
|
#define DF_HARD_REGS 1024 /* Mark hard registers. */
|
|
|
|
#define DF_EQUIV_NOTES 2048 /* Mark uses present in EQUIV/EQUAL notes. */
|
2001-06-29 00:11:19 +02:00
|
|
|
|
|
|
|
enum df_ref_type {DF_REF_REG_DEF, DF_REF_REG_USE, DF_REF_REG_MEM_LOAD,
|
|
|
|
DF_REF_REG_MEM_STORE};
|
|
|
|
|
|
|
|
#define DF_REF_TYPE_NAMES {"def", "use", "mem load", "mem store"}
|
|
|
|
|
|
|
|
/* Link on a def-use or use-def chain. */
|
|
|
|
struct df_link
|
|
|
|
{
|
|
|
|
struct df_link *next;
|
|
|
|
struct ref *ref;
|
|
|
|
};
|
|
|
|
|
2001-11-19 18:08:48 +01:00
|
|
|
enum df_ref_flags
|
|
|
|
{
|
2003-01-26 07:10:37 +01:00
|
|
|
/* Read-modify-write refs generate both a use and a def and
|
|
|
|
these are marked with this flag to show that they are not
|
|
|
|
independent. */
|
[multiple changes]
2002-07-15 Michael Matz <matz@suse.de>,
Daniel Berlin <dberlin@dberlin.org>,
Denis Chertykov <denisc@overta.ru>
Add a new register allocator.
* ra.c: New file.
* ra.h: New file.
* ra-build.c: New file.
* ra-colorize.c: New file.
* ra-debug.c: New file.
* ra-rewrite.c: New file.
* Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
(ra-rewrite.o): New .o files for libbackend.a.
(GTFILES): Add basic-block.h.
* toplev.c (flag_new_regalloc): New.
(f_options): New option "new-ra".
(rest_of_compilation): Call initialize_uninitialized_subregs()
only for the old allocator. If flag_new_regalloc is set, call
new allocator, instead of local_alloc(), global_alloc() and
friends.
* doc/invoke.texi: Document -fnew-ra.
* basic-block.h (FOR_ALL_BB): New.
* config/rs6000/rs6000.c (print_operand): Write small constants
as @l+80.
* df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg.
(df_reg_table_realloc): Make size at least as large as max_reg_num().
(df_insn_table_realloc): Size argument now is absolute, not relative.
Changed all callers.
* gengtype.c (main): Add the pseudo-type "HARD_REG_SET".
* regclass.c (reg_scan_mark_refs): Ignore NULL rtx's.
2002-06-20 Michael Matz <matz@suse.de>
* df.h (struct ref.id): Make unsigned.
* df.c (df_bb_reg_def_chain_create): Remove unsigned cast.
2002-06-13 Michael Matz <matz@suse.de>
* df.h (DF_REF_MODE_CHANGE): New flag.
* df.c (df_def_record_1, df_uses_record): Set this flag for refs
involving subregs with invalid mode changes, when
CLASS_CANNOT_CHANGE_MODE is defined.
2002-05-07 Michael Matz <matz@suse.de>
* reload1.c (fixup_abnormal_edges): Don't insert on NULL edge.
2002-05-03 Michael Matz <matz@suse.de>
* sbitmap.c (sbitmap_difference): Accept sbitmaps of different size.
Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru>
* regclass.c (regclass): Work with all regs which have sets or
refs.
(reg_scan_mark_refs): Count regs inside (clobber ...).
2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de>
* df.c (df_ref_record): Correctly calculate SUBREGs of hardregs.
(df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only
add new refs.
(df_bb_refs_update): Don't clear insns_modified here, ...
(df_analyse): ... but here.
* sbitmap.c (dump_sbitmap_file): New.
(debug_sbitmap): Use it.
* sbitmap.h (dump_sbitmap_file): Add prototype.
2001-08-07 Daniel Berlin <dan@cgsoftware.com>
* df.c (df_insn_modify): Grow the UID table if necessary, rather
than assume all emits go through df_insns_modify.
2001-07-26 Daniel Berlin <dan@cgsoftware.com>
* regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS,
increase REG_N_REFS (like flow does), so that regclass doesn't
think a reg is useless, and thus, not calculate a class, when it
really should have.
2001-01-28 Daniel Berlin <dberlin@redhat.com>
* sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for
dataflow analysis.
From-SVN: r55458
2002-07-15 16:07:06 +02:00
|
|
|
DF_REF_READ_WRITE = 1,
|
2003-06-29 17:19:13 +02:00
|
|
|
|
2003-03-07 23:06:16 +01:00
|
|
|
/* This flag is set, if we stripped the subreg from the reference.
|
|
|
|
In this case we must make conservative guesses, at what the
|
|
|
|
outer mode was. */
|
2005-02-10 19:46:31 +01:00
|
|
|
DF_REF_STRIPPED = 2
|
2001-11-19 18:08:48 +01:00
|
|
|
};
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-01-26 07:10:37 +01:00
|
|
|
|
|
|
|
/* Define a register reference structure. One of these is allocated
|
|
|
|
for every register reference (use or def). Note some register
|
|
|
|
references (e.g., post_inc, subreg) generate both a def and a use. */
|
2001-06-29 00:11:19 +02:00
|
|
|
struct ref
|
|
|
|
{
|
|
|
|
rtx reg; /* The register referenced. */
|
|
|
|
rtx insn; /* Insn containing ref. */
|
2003-01-26 07:10:37 +01:00
|
|
|
rtx *loc; /* The location of the reg. */
|
2001-06-29 00:11:19 +02:00
|
|
|
struct df_link *chain; /* Head of def-use or use-def chain. */
|
[multiple changes]
2002-07-15 Michael Matz <matz@suse.de>,
Daniel Berlin <dberlin@dberlin.org>,
Denis Chertykov <denisc@overta.ru>
Add a new register allocator.
* ra.c: New file.
* ra.h: New file.
* ra-build.c: New file.
* ra-colorize.c: New file.
* ra-debug.c: New file.
* ra-rewrite.c: New file.
* Makefile.in (ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
(ra-rewrite.o): New .o files for libbackend.a.
(GTFILES): Add basic-block.h.
* toplev.c (flag_new_regalloc): New.
(f_options): New option "new-ra".
(rest_of_compilation): Call initialize_uninitialized_subregs()
only for the old allocator. If flag_new_regalloc is set, call
new allocator, instead of local_alloc(), global_alloc() and
friends.
* doc/invoke.texi: Document -fnew-ra.
* basic-block.h (FOR_ALL_BB): New.
* config/rs6000/rs6000.c (print_operand): Write small constants
as @l+80.
* df.c (read_modify_subreg_p): Narrow down cases for a rmw subreg.
(df_reg_table_realloc): Make size at least as large as max_reg_num().
(df_insn_table_realloc): Size argument now is absolute, not relative.
Changed all callers.
* gengtype.c (main): Add the pseudo-type "HARD_REG_SET".
* regclass.c (reg_scan_mark_refs): Ignore NULL rtx's.
2002-06-20 Michael Matz <matz@suse.de>
* df.h (struct ref.id): Make unsigned.
* df.c (df_bb_reg_def_chain_create): Remove unsigned cast.
2002-06-13 Michael Matz <matz@suse.de>
* df.h (DF_REF_MODE_CHANGE): New flag.
* df.c (df_def_record_1, df_uses_record): Set this flag for refs
involving subregs with invalid mode changes, when
CLASS_CANNOT_CHANGE_MODE is defined.
2002-05-07 Michael Matz <matz@suse.de>
* reload1.c (fixup_abnormal_edges): Don't insert on NULL edge.
2002-05-03 Michael Matz <matz@suse.de>
* sbitmap.c (sbitmap_difference): Accept sbitmaps of different size.
Sat Feb 2 18:58:07 2002 Denis Chertykov <denisc@overta.ru>
* regclass.c (regclass): Work with all regs which have sets or
refs.
(reg_scan_mark_refs): Count regs inside (clobber ...).
2002-01-04 Michael Matz <matzmich@cs.tu-berlin.de>
* df.c (df_ref_record): Correctly calculate SUBREGs of hardregs.
(df_bb_reg_def_chain_create, df_bb_reg_use_chain_create): Only
add new refs.
(df_bb_refs_update): Don't clear insns_modified here, ...
(df_analyse): ... but here.
* sbitmap.c (dump_sbitmap_file): New.
(debug_sbitmap): Use it.
* sbitmap.h (dump_sbitmap_file): Add prototype.
2001-08-07 Daniel Berlin <dan@cgsoftware.com>
* df.c (df_insn_modify): Grow the UID table if necessary, rather
than assume all emits go through df_insns_modify.
2001-07-26 Daniel Berlin <dan@cgsoftware.com>
* regclass.c (reg_scan_mark_refs): When we increase REG_N_SETS,
increase REG_N_REFS (like flow does), so that regclass doesn't
think a reg is useless, and thus, not calculate a class, when it
really should have.
2001-01-28 Daniel Berlin <dberlin@redhat.com>
* sbitmap.h (EXECUTE_IF_SET_IN_SBITMAP_REV): New macro, needed for
dataflow analysis.
From-SVN: r55458
2002-07-15 16:07:06 +02:00
|
|
|
unsigned int id; /* Ref index. */
|
2003-01-26 07:10:37 +01:00
|
|
|
enum df_ref_type type; /* Type of ref. */
|
2001-11-19 18:08:48 +01:00
|
|
|
enum df_ref_flags flags; /* Various flags. */
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
void *data; /* The data assigned to it by user. */
|
2001-06-29 00:11:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* One of these structures is allocated for every insn. */
|
|
|
|
struct insn_info
|
|
|
|
{
|
|
|
|
struct df_link *defs; /* Head of insn-def chain. */
|
|
|
|
struct df_link *uses; /* Head of insn-use chain. */
|
2003-07-01 14:18:01 +02:00
|
|
|
/* ???? The following luid field should be considered private so that
|
ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
ChangeLog.5, ChangeLog, ChangeLog.lib, FSFChangeLog.10, ONEWS,
c-common.c, caller-save.c, cfg.c, cfgcleanup.c, cfgrtl.c,
collect2.c, df.h, diagnostic.h, final.c, gcse.c, gthr.h,
haifa-sched.c, jump.c, local-alloc.c, profile.c, protoize.c,
regmove.c, reload1.c, rtlanal.c, sched-vis.c, ssa.c, stmt.c,
system.h, toplev.c: Fix spelling errors.
From-SVN: r46580
2001-10-28 13:42:06 +01:00
|
|
|
we can change it on the fly to accommodate new insns? */
|
2001-06-29 00:11:19 +02:00
|
|
|
int luid; /* Logical UID. */
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* One of these structures is allocated for every reg. */
|
|
|
|
struct reg_info
|
|
|
|
{
|
|
|
|
struct df_link *defs; /* Head of reg-def chain. */
|
|
|
|
struct df_link *uses; /* Head of reg-use chain. */
|
|
|
|
int lifetime;
|
|
|
|
int n_defs;
|
|
|
|
int n_uses;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* One of these structures is allocated for every basic block. */
|
|
|
|
struct bb_info
|
|
|
|
{
|
|
|
|
/* Reaching def bitmaps have def_id elements. */
|
|
|
|
bitmap rd_kill;
|
|
|
|
bitmap rd_gen;
|
|
|
|
bitmap rd_in;
|
|
|
|
bitmap rd_out;
|
|
|
|
/* Reaching use bitmaps have use_id elements. */
|
|
|
|
bitmap ru_kill;
|
|
|
|
bitmap ru_gen;
|
|
|
|
bitmap ru_in;
|
|
|
|
bitmap ru_out;
|
|
|
|
/* Live variable bitmaps have n_regs elements. */
|
|
|
|
bitmap lr_def;
|
|
|
|
bitmap lr_use;
|
|
|
|
bitmap lr_in;
|
|
|
|
bitmap lr_out;
|
|
|
|
int rd_valid;
|
|
|
|
int ru_valid;
|
|
|
|
int lr_valid;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct df
|
|
|
|
{
|
|
|
|
int flags; /* Indicates what's recorded. */
|
|
|
|
struct bb_info *bbs; /* Basic block table. */
|
|
|
|
struct ref **defs; /* Def table, indexed by def_id. */
|
|
|
|
struct ref **uses; /* Use table, indexed by use_id. */
|
|
|
|
struct ref **reg_def_last; /* Indexed by regno. */
|
|
|
|
struct reg_info *regs; /* Regs table, index by regno. */
|
|
|
|
unsigned int reg_size; /* Size of regs table. */
|
|
|
|
struct insn_info *insns; /* Insn table, indexed by insn UID. */
|
|
|
|
unsigned int insn_size; /* Size of insn table. */
|
|
|
|
unsigned int def_id; /* Next def ID. */
|
|
|
|
unsigned int def_size; /* Size of def table. */
|
|
|
|
unsigned int n_defs; /* Size of def bitmaps. */
|
|
|
|
unsigned int use_id; /* Next use ID. */
|
|
|
|
unsigned int use_size; /* Size of use table. */
|
|
|
|
unsigned int n_uses; /* Size of use bitmaps. */
|
|
|
|
unsigned int n_bbs; /* Number of basic blocks. */
|
|
|
|
unsigned int n_regs; /* Number of regs. */
|
|
|
|
unsigned int def_id_save; /* Saved next def ID. */
|
|
|
|
unsigned int use_id_save; /* Saved next use ID. */
|
|
|
|
bitmap insns_modified; /* Insns that (may) have changed. */
|
|
|
|
bitmap bbs_modified; /* Blocks that (may) have changed. */
|
|
|
|
bitmap all_blocks; /* All blocks in CFG. */
|
2003-01-26 07:10:37 +01:00
|
|
|
int *dfs_order; /* DFS order -> block number. */
|
|
|
|
int *rc_order; /* Reverse completion order -> block number. */
|
|
|
|
int *rts_order; /* Reverse top sort order -> block number. */
|
|
|
|
int *inverse_rc_map; /* Block number -> reverse completion order. */
|
|
|
|
int *inverse_dfs_map; /* Block number -> DFS order. */
|
|
|
|
int *inverse_rts_map; /* Block number -> reverse top-sort order. */
|
2001-06-29 00:11:19 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct df_map
|
|
|
|
{
|
|
|
|
rtx old;
|
|
|
|
rtx new;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2002-05-17 04:31:56 +02:00
|
|
|
#define DF_BB_INFO(REFS, BB) (&REFS->bbs[(BB)->index])
|
2001-06-29 00:11:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Macros to access the elements within the ref structure. */
|
2003-01-26 07:10:37 +01:00
|
|
|
|
2001-06-29 00:11:19 +02:00
|
|
|
#define DF_REF_REAL_REG(REF) (GET_CODE ((REF)->reg) == SUBREG \
|
|
|
|
? SUBREG_REG ((REF)->reg) : ((REF)->reg))
|
|
|
|
#define DF_REF_REGNO(REF) REGNO (DF_REF_REAL_REG (REF))
|
|
|
|
#define DF_REF_REAL_LOC(REF) (GET_CODE ((REF)->reg) == SUBREG \
|
|
|
|
? &SUBREG_REG ((REF)->reg) : ((REF)->loc))
|
|
|
|
#define DF_REF_REG(REF) ((REF)->reg)
|
|
|
|
#define DF_REF_LOC(REF) ((REF)->loc)
|
2002-01-25 20:46:43 +01:00
|
|
|
#define DF_REF_BB(REF) (BLOCK_FOR_INSN ((REF)->insn))
|
2002-05-17 04:31:56 +02:00
|
|
|
#define DF_REF_BBNO(REF) (BLOCK_FOR_INSN ((REF)->insn)->index)
|
2001-06-29 00:11:19 +02:00
|
|
|
#define DF_REF_INSN(REF) ((REF)->insn)
|
|
|
|
#define DF_REF_INSN_UID(REF) (INSN_UID ((REF)->insn))
|
|
|
|
#define DF_REF_TYPE(REF) ((REF)->type)
|
|
|
|
#define DF_REF_CHAIN(REF) ((REF)->chain)
|
|
|
|
#define DF_REF_ID(REF) ((REF)->id)
|
2001-11-19 18:08:48 +01:00
|
|
|
#define DF_REF_FLAGS(REF) ((REF)->flags)
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
#define DF_REF_DATA(REF) ((REF)->data)
|
2001-06-29 00:11:19 +02:00
|
|
|
|
|
|
|
/* Macros to determine the reference type. */
|
|
|
|
|
|
|
|
#define DF_REF_REG_DEF_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_DEF)
|
|
|
|
#define DF_REF_REG_USE_P(REF) ((REF) && ! DF_REF_REG_DEF_P (REF))
|
|
|
|
#define DF_REF_REG_MEM_STORE_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_STORE)
|
|
|
|
#define DF_REF_REG_MEM_LOAD_P(REF) (DF_REF_TYPE (REF) == DF_REF_REG_MEM_LOAD)
|
|
|
|
#define DF_REF_REG_MEM_P(REF) (DF_REF_REG_MEM_STORE_P (REF) \
|
2003-01-26 07:10:37 +01:00
|
|
|
|| DF_REF_REG_MEM_LOAD_P (REF))
|
2001-06-29 00:11:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Macros to access the elements within the reg_info structure table. */
|
|
|
|
|
|
|
|
#define DF_REGNO_FIRST_DEF(DF, REGNUM) \
|
|
|
|
((DF)->regs[REGNUM].defs ? (DF)->regs[REGNUM].defs->ref : 0)
|
|
|
|
#define DF_REGNO_LAST_USE(DF, REGNUM) \
|
|
|
|
((DF)->regs[REGNUM].uses ? (DF)->regs[REGNUM].uses->ref : 0)
|
|
|
|
|
|
|
|
#define DF_REGNO_FIRST_BB(DF, REGNUM) \
|
|
|
|
(DF_REGNO_FIRST_DEF (DF, REGNUM) \
|
|
|
|
? DF_REF_BB (DF_REGNO_FIRST_DEF (DF, REGNUM)) : 0)
|
|
|
|
#define DF_REGNO_LAST_BB(DF, REGNUM) \
|
|
|
|
(DF_REGNO_LAST_USE (DF, REGNUM) \
|
|
|
|
? DF_REF_BB (DF_REGNO_LAST_USE (DF, REGNUM)) : 0)
|
|
|
|
|
|
|
|
|
|
|
|
/* Macros to access the elements within the insn_info structure table. */
|
|
|
|
|
|
|
|
#define DF_INSN_LUID(DF, INSN) ((DF)->insns[INSN_UID (INSN)].luid)
|
|
|
|
#define DF_INSN_DEFS(DF, INSN) ((DF)->insns[INSN_UID (INSN)].defs)
|
|
|
|
#define DF_INSN_USES(DF, INSN) ((DF)->insns[INSN_UID (INSN)].uses)
|
|
|
|
|
|
|
|
|
c-common.c, [...]: Fix comment typos.
* c-common.c, calls.c, cfgcleanup.c, cgraph.c, cgraphunit.c,
ddg.c, ddg.h, df.c, df.h, except.c, expr.c, flags.h,
fold-const.c, gcc.c, gimplify.c, haifa-sched.c,
modulo-sched.c, tree-inline.c, tree-into-ssa.c, tree-nested.c,
tree-nrv.c, tree-ssa-ccp.c, tree-ssa-dom.c, tree-ssa-live.c,
tree-ssa-loop.c, tree-ssa-pre.c, tree-tailcall.c, tree.h: Fix
comment typos. Follow spelling conventions.
From-SVN: r82439
2004-05-30 09:12:58 +02:00
|
|
|
/* Functions to build and analyze dataflow information. */
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern struct df *df_init (void);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2004-02-24 14:55:06 +01:00
|
|
|
extern int df_analyze (struct df *, bitmap, int);
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
extern void df_analyze_subcfg (struct df *, bitmap, int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void df_finish (struct df *);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void df_dump (struct df *, int, FILE *);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-01-26 07:10:37 +01:00
|
|
|
|
2001-06-29 00:11:19 +02:00
|
|
|
/* Functions to modify insns. */
|
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void df_insn_modify (struct df *, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern rtx df_insn_delete (struct df *, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern rtx df_pattern_emit_before (struct df *, rtx, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern rtx df_jump_pattern_emit_after (struct df *, rtx, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern rtx df_pattern_emit_after (struct df *, rtx, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern rtx df_insn_move_before (struct df *, basic_block, rtx, basic_block,
|
|
|
|
rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_reg_replace (struct df *, bitmap, rtx, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_ref_reg_replace (struct df *, struct ref *, rtx, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_ref_remove (struct df *, struct ref *);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_insn_mem_replace (struct df *, basic_block, rtx, rtx, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern struct ref *df_bb_def_use_swap (struct df *, basic_block, rtx, rtx,
|
|
|
|
unsigned int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* Functions to query dataflow information. */
|
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern basic_block df_regno_bb (struct df *, unsigned int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_reg_lifetime (struct df *, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_reg_global_p (struct df *, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_insn_regno_def_p (struct df *, basic_block, rtx, unsigned int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_insn_dominates_all_uses_p (struct df *, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_insn_dominates_uses_p (struct df *, basic_block, rtx, bitmap);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_bb_reg_live_start_p (struct df *, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_bb_reg_live_end_p (struct df *, basic_block, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern int df_bb_regs_lives_compare (struct df *, basic_block, rtx, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern rtx df_bb_single_def_use_insn_find (struct df *, basic_block, rtx,
|
|
|
|
rtx);
|
ddg.h, [...]: New files.
* ddg.h, ddg.c, modulo-sched.c: New files.
* cfglayout.c (duplicate_insn_chain): Remove "static" and push
internals to "dupicate_insn".
(duplicate_insn): New function.
* cfglayout.h (duplicate_insn_chain, duplicate_insn): New
declarations.
* common.opt (fmodulo-sched): New flag.
* df.c (df_bb_regno_last_use_find, df_bb_regno_first_def_find):
Remove static and forward declaration.
(df_find_def, df_reg_used, df_bb_regno_last_def_find): New
functions.
* df.h (df_bb_regno_last_use_find, df_bb_regno_first_def_find,
df_bb_regno_last_def_find, df_find_def, df_reg_used): New
declarations.
* flags.h (flag_modulo_sched): New flag.
* opts.c (common_handle_option): Handle modulo-sched flag.
* params.def (max-sms-loop-number, sms-max-ii-factor,
sms-dfa-history, sms-loop-average-count-threshold): New
parameters.
* params.h (MAX_SMS_LOOP_NUMBER, SMS_MAX_II_FACTOR,
SMS_DFA_HISTORY, SMS_LOOP_AVERAGE_COUNT_THRESHOLD): New
parameters.
* passes.c ("sms", "sms-vcg"): New dumps.
(rest_of_handle_sched): Call sms_schedule.
* rtl.h (sms_schedule): New declaration.
* timevar.def (TV_SMS): New.
* toplev.c (flag_modulo_sched): Initialize.
(f_options): Handle -fmodulo-sched option.
* docs/invoke.texi: Document -fmodulo-sched & -dm options.
* docs/passes.texi: Document new SMS pass.f toplev.c doc/invoke.texi doc/passes.texi
Co-Authored-By: Mostafa Hagog <mustafa@il.ibm.com>
From-SVN: r82235
2004-05-25 14:55:06 +02:00
|
|
|
extern struct ref *df_bb_regno_last_use_find (struct df *, basic_block, unsigned int);
|
|
|
|
|
|
|
|
extern struct ref *df_bb_regno_first_def_find (struct df *, basic_block, unsigned int);
|
|
|
|
|
|
|
|
extern struct ref *df_bb_regno_last_def_find (struct df *, basic_block, unsigned int);
|
|
|
|
|
|
|
|
extern struct ref *df_find_def (struct df *, rtx, rtx);
|
|
|
|
|
|
|
|
extern int df_reg_used (struct df *, rtx, rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
|
|
|
/* Functions for debugging from GDB. */
|
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_insn (rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_regno (unsigned int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_reg (rtx);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_defno (unsigned int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_useno (unsigned int);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_ref (struct ref *);
|
2001-06-29 00:11:19 +02:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void debug_df_chain (struct df_link *);
|
2003-01-26 07:10:37 +01:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void df_insn_debug (struct df *, rtx, FILE *);
|
2003-01-26 07:10:37 +01:00
|
|
|
|
2003-06-29 17:19:13 +02:00
|
|
|
extern void df_insn_debug_regno (struct df *, rtx, FILE *);
|
2003-01-26 07:10:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Meet over any path (UNION) or meet over all paths (INTERSECTION). */
|
2001-11-07 17:34:37 +01:00
|
|
|
enum df_confluence_op
|
|
|
|
{
|
2003-01-26 07:10:37 +01:00
|
|
|
DF_UNION,
|
|
|
|
DF_INTERSECTION
|
2001-11-07 17:34:37 +01:00
|
|
|
};
|
2003-01-26 07:10:37 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Dataflow direction. */
|
2001-11-07 17:34:37 +01:00
|
|
|
enum df_flow_dir
|
|
|
|
{
|
2003-01-26 07:10:37 +01:00
|
|
|
DF_FORWARD,
|
|
|
|
DF_BACKWARD
|
2001-11-07 17:34:37 +01:00
|
|
|
};
|
|
|
|
|
2003-01-26 07:10:37 +01:00
|
|
|
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
typedef void (*transfer_function) (int, int *, void *, void *,
|
|
|
|
void *, void *, void *);
|
|
|
|
|
|
|
|
/* The description of a dataflow problem to solve. */
|
2003-01-26 07:10:37 +01:00
|
|
|
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
enum set_representation
|
|
|
|
{
|
|
|
|
SR_SBITMAP, /* Represent sets by bitmaps. */
|
|
|
|
SR_BITMAP /* Represent sets by sbitmaps. */
|
|
|
|
};
|
2001-11-07 17:34:37 +01:00
|
|
|
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
struct dataflow
|
|
|
|
{
|
|
|
|
enum set_representation repr; /* The way the sets are represented. */
|
|
|
|
|
|
|
|
/* The following arrays are indexed by block indices, so they must always
|
|
|
|
be large enough even if we restrict ourselves just to a subset of cfg. */
|
|
|
|
void **gen, **kill; /* Gen and kill sets. */
|
|
|
|
void **in, **out; /* Results. */
|
|
|
|
|
|
|
|
enum df_flow_dir dir; /* Dataflow direction. */
|
|
|
|
enum df_confluence_op conf_op; /* Confluence operator. */
|
|
|
|
unsigned n_blocks; /* Number of basic blocks in the
|
|
|
|
order. */
|
|
|
|
int *order; /* The list of basic blocks to work
|
|
|
|
with, in the order they should
|
|
|
|
be processed in. */
|
|
|
|
transfer_function transfun; /* The transfer function. */
|
|
|
|
void *data; /* Data used by the transfer
|
|
|
|
function. */
|
|
|
|
};
|
2003-01-26 07:10:37 +01:00
|
|
|
|
Makefile.in (df.o): Remove fibheap dependency.
* Makefile.in (df.o): Remove fibheap dependency.
* df.h: Do not include sbitmap.h.
(struct ref): New field "data".
(DF_REF_DATA): New accessor macro.
(struct df): Field "dom" removed.
(df_analyze_subcfg): New function.
(transfer_function_sbitmap, transfer_function_bitmap): Replaced by ...
(transfer_function): ... new type.
(iterative_dataflow_sbitmap, iterative_dataflow_bitmap): Replaced by ...
(iterative_dataflow): ... new function.
(enum set_representation, struct dataflow): New.
* df.c: Do not include fibheap.h.
(df_reg_def_chain_clean, df_reg_use_chain_clean,
(df_bb_table_realloc, df_analyse_subcfg, free_reg_ref_chain,
prune_to_subcfg, df_bb_modify): New functions.
(df_bitmaps_alloc, df_reg_def_chain_create, df_reg_use_chain_create,
df_refs_update, df_reg_table_realloc, df_ref_create,
df_bb_reg_def_chain_create, df_bb_reg_use_chain_create,
df_bb_rd_local_compute, df_bb_ru_local_compute, df_bb_lr_local_compute,
df_analyse_1, df_insn_modify): Support analysing only a part of the cfg.
(dataflow_set_a_op_b, dataflow_set_copy): New functions.
(df_rd_transfer_function, df_ru_transfer_function,
df_lr_transfer_function): Type of bitmaps changed to void *.
(hybrid_search_bitmap, hybrid_search_sbitmap): Merge into ...
(hybrid_search): ... new function.
(iterative_dataflow_bitmap, iterative_dataflow_sbitmap): Merge into ...
(iterative_dataflow): ... new function. Avoid use of fibheaps for
a worklist. Do not process basic blocks unnecessarily.
From-SVN: r82921
2004-06-10 17:01:01 +02:00
|
|
|
extern void iterative_dataflow (struct dataflow *);
|
2003-06-29 17:19:13 +02:00
|
|
|
extern bool read_modify_subreg_p (rtx);
|
Makefile.in (RA_H, [...]): New.
2004-06-03 Jerry Quinn <jlquinn@optonline.net>
* Makefile.in (RA_H, RESOURCE_H, SCHED_INT_H, CFGLAYOUT_H,
CFGLOOP_H, DF_H, DDG_H, TREE_SSA_LIVE_H): New.
(TARGET_H): Add insn-modes.h.
(tree-ssa.o, tree-cfg.o, tree-ssa-loop.o, toplev.o, passes.o,
loop.o, loop-doloop.o, unroll.o, cfgloop.o, cfgloopanal.o,
loop-iv.o, cfgloopmanip.o, loop-init.o, loop-unswitch.o,
loop-unroll.o, ddg.o, modulo-sched.o, predict.o,
cfglayout.o, ifcvt.o): Replace cfgloop.h with CFGLOOP_H.
(toplev.o, passes.o, cfghooks.o, cfgloopmanip.o, loop-init.o,
loop-unswitch.o, loop-unroll.o, ddg.o, modulo-sched.o,
bb-reorder.o, tracer.o, cfglayout.o): Replace cfglayout.h with
CFGLAYOUT_H.
(ra.o, ra-build.o, ra-colorize.o, ra-debug.o, ra-rewrite.o):
Replace ra.h with RA_H.
(resource.o, regrename.o, insn-conditions.o, insn-emit.o,
insn-recog.o): Replace resource.h with RESOURCE_H.
(ddg.o, modulo-sched.o, haifa-sched.o, sched-deps.o, sched-rgn.o,
sched-ebb.o, sched-vis.o, out_object_file): Replace sched-int.h
with SCHED_INT_H.
(web.o, lcm.o, df.o, ra.o, ra-build.o, ra-colorize.o, ra-debug.o,
ra-rewrite.o): Replace df.h with DF_H.
(ddg.o, modulo-sched.o): Replace ddf.h with DDG_H.
(tree-outof-ssa.o, tree-ssa-live.o, tree-ssa-copyrename.o):
Replace tree-ssa-live.h with TREE_SSA_LIVE_H.
(insn-conditions.o): Remove unused reload.h.
* cfglayout.h: Add include guard. Include basic-block.h.
* cfgloop.h: Add include guard. Include basic-block.h, rtl.h.
* ddg.h: Include sbitmap.h, basic-block.h, df.h.
* df.h: Add include guard. Include bitmap.h, sbitmap.h,
basic-block.h.
* genconditions.c: Remove reload.h.
* ra.h: Add include guard. Include bitmap.h, sbitmap.h,
hard-reg-set.h, insn-modes.h.
* resource.h: Add include guard. Include hard-reg-set.h.
* sched-int.h: Add include guard. Include insn-attr.h,
basic-block.h, rtl.h.
* target.h: Add include guard. Include insn-modes.h.
* tree-ssa-live.h: Include partition.h.
From-SVN: r82600
2004-06-03 17:01:08 +02:00
|
|
|
|
|
|
|
#endif /* GCC_DF_H */
|