gcc/gcc/lists.c

193 lines
4.7 KiB
C
Raw Normal View History

/* List management for the GCC expander.
2000-02-26 14:55:09 +01:00
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +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.
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +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.
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +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.
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +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. */
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
#include "toplev.h"
#include "rtl.h"
#include "ggc.h"
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
static void free_list (rtx *, rtx *);
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
/* Functions for maintaining cache-able lists of EXPR_LIST and INSN_LISTs. */
/* An INSN_LIST containing all INSN_LISTs allocated but currently unused. */
static GTY ((deletable)) rtx unused_insn_list;
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
/* An EXPR_LIST containing all EXPR_LISTs allocated but currently unused. */
static GTY ((deletable)) rtx unused_expr_list;
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
/* This function will free an entire list of either EXPR_LIST, INSN_LIST
or DEPS_LIST nodes. This is to be used only on lists that consist
exclusively of nodes of one type only. This is only called by
free_EXPR_LIST_list, free_INSN_LIST_list and free_DEPS_LIST_list. */
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
static void
free_list (rtx *listp, rtx *unused_listp)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
alias.c: Remove uses of "register" specifier in declarations of arguments and local... 2001-10-10 Stan Shebs <shebs@apple.com> * alias.c: Remove uses of "register" specifier in declarations of arguments and local variables. * c-common.c: Ditto. * c-convert.c: Ditto. * c-decl.c: Ditto. * c-format.c: Ditto. * c-semantics.c: Ditto. * c-typeck.c: Ditto. * caller-save.c: Ditto. * calls.c: Ditto. * cfg.c: Ditto. * cfgbuild.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * combine.c: Ditto. * convert.c: Ditto. * cppexp.c: Ditto. * cppfiles.c: Ditto. * cse.c: Ditto. * dbxout.c: Ditto. * defaults.h: Ditto. * df.c: Ditto. * dwarf2out.c: Ditto. * dwarfout.c: Ditto. * emit-rtl.c: Ditto. * explow.c: Ditto. * expmed.c: Ditto. * expr.c: Ditto. * final.c: Ditto. * fix-header.c: Ditto. * floatlib.c: Ditto. * flow.c: Ditto. * fold-const.c: Ditto. * function.c: Ditto. * gcc.c: Ditto. * gcse.c: Ditto. * gen-protos.c: Ditto. * genattrtab.c: Ditto. * gencheck.c: Ditto. * genconfig.c: Ditto. * genemit.c: Ditto. * genextract.c: Ditto. * genflags.c: Ditto. * gengenrtl.c: Ditto. * genoutput.c: Ditto. * genpeep.c: Ditto. * genrecog.c: Ditto. * gensupport.c: Ditto. * global.c: Ditto. * gmon.c: Ditto. * graph.c: Ditto. * haifa-sched.c: Ditto. * hard-reg-set.h: Ditto. * hash.c: Ditto. * integrate.c: Ditto. * jump.c: Ditto. * lists.c: Ditto. * local-alloc.c: Ditto. * loop.c: Ditto. * mips-tdump.c: Ditto. * mips-tfile.c: Ditto. * optabs.c: Ditto. * prefix.c: Ditto. * print-rtl.c: Ditto. * read-rtl.c: Ditto. * real.c: Ditto. * recog.c: Ditto. * reg-stack.c: Ditto. * regclass.c: Ditto. * regmove.c: Ditto. * reload.c: Ditto. * reload1.c: Ditto. * reorg.c: Ditto. * resource.c: Ditto. * rtl.c: Ditto. * rtlanal.c: Ditto. * scan.c: Ditto. * sched-deps.c: Ditto. * sched-rgn.c: Ditto. * sdbout.c: Ditto. * simplify-rtx.c: Ditto. * stmt.c: Ditto. * stor-layout.c: Ditto. * toplev.c: Ditto. * tradcif.y: Ditto. * tradcpp.c: Ditto. * tree.c: Ditto. * unroll.c: Ditto. * varasm.c: Ditto. * xcoffout.c: Ditto. From-SVN: r46173
2001-10-11 05:16:15 +02:00
rtx link, prev_link;
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
prev_link = *listp;
link = XEXP (prev_link, 1);
re PR middle-end/28071 (A file that can not be compiled in reasonable time/space) * sched-int.h (ds_to_dk, dk_to_ds): Declare functions. (struct _dep): New type. (dep_t): New typedef. (DEP_PRO, DEP_CON, DEP_KIND): New access macros. (DEP_STATUS): New access macro. The macro with the same name was renamed to DEP_LINK_STATUS. (dep_init): Declare function (struct _dep_link): New type. (dep_link_t): New typedef. (DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros. (DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros. (DEP_LINK_STATUS): New macro. (debug_dep_links): New debug function. (struct _deps_list): New type. (deps_list_t): New typedef. (DEPS_LIST_FIRST): New access macro. (FOR_EACH_DEP_LINK): New cycle macro. (create_deps_list, free_deps_list, delete_deps_list): Declare functions. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Ditto. (move_dep_link): Declare function. (struct _dep_node): New type. (dep_node_t): New typedef. (DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros. (struct haifa_insn_data.back_deps): New field to hold backward dependencies of the insn. (struct haifa_insn_data.depend): Rename to forw_deps. Change its type to deps_list_t. (struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps. Change its type to deps_list_t. (INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS. (INSN_DEPEND): Rename to INSN_FORW_DEPS. (RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS. (INSN_COST): Move to haifa-sched.c. Use insn_cost () instead. (DEP_STATUS): Rename to DEP_LINK_STATUS. Fix typo in the comment. (add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and all callers. (dep_cost): Declare. * sched-deps.c (CHECK): New macro to (en/dis)able sanity checks. (ds_to_dk, dk_to_ds): New functions. (init_dep_1): New static function. (init_dep): New function. (copy_dep): New static function. (dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static functions. (detach_dep_link): New static function. (move_dep_link): New function. (dep_links_consistent_p, dump_dep_links): New static functions. (debug_dep_links): New debugging function. (deps_obstack, dl_obstack, dn_obstack): New static variables. (alloc_deps_list, init_deps_list): New static functions. (create_deps_list): New function. (clear_deps_list): New static function. (free_deps_list, delete_deps_list, deps_list_empty_p): New functions. (deps_list_consistent_p, dump_deps_list): New static functions. (debug_deps_list): New function. (add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New functions. (find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to use new scheduler dependencies lists. (add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto. (sched_analyze): Ditto. Initialize dependencies lists. (add_forw_dep, compute_forward_dependences): Update to use new scheduler dependencies lists. (init_dependency_caches): Init deps_obstack. (free_dependency_caches): Free deps_obstack. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use new scheduler dependencies lists. (delete_forw_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. * sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree): Update to use new scheduler dependencies lists. (is_conditionally_protected, is_prisky, add_branch_dependences): Ditto. (debug_dependencies): Ditto. (schedule_region): Update comments. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new scheduler dependencies lists. (schedule_ebb): Update comments. * rtl.def (DEPS_LIST): Remove. * lists.c (unused_deps_list): Remove. (free_list): Update assertions. (alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * haifa-sched.c (comments): Update. (insn_cost1): Remove. Inline the code into insn_cost (). (insn_cost): Update to use new scheduler dependencies lists. Move processing of the dependency cost to dep_cost (). (dep_cost): New function. Use it instead of insn_cost () when evaluating cost of the dependency. Use compatible interface to interact with the target. (priority): Update to use new scheduler dependencies lists. (rank_for_schedule): Ditto. Optimize heuristic that prefers the insn with greater number of insns that depend on the insn. (schedule_insn): Update to use new scheduler dependencies lists. Add code to free backward dependencies lists. Inline and optimize code from resolve_dep () - see PR28071. (ok_for_early_queue_removal): Update to use new scheduler dependencies lists. Update call to targetm.sched.is_costly_dependence hook. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new scheduler dependencies lists. (resolve_dep): Remove. Move the logic to schedule_insn (). (init_h_i_d): Initialize dependencies lists. (process_insn_depend_be_in_spec): Rename to process_insn_forw_deps_be_in_spec. Update to use new scheduler dependencies lists. (add_to_speculative_block, create_check_block_twin, fix_recovery_deps): Update to use new scheduler dependencies lists. (clear_priorities, calc_priorities, add_jump_dependencies): Ditto. * ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use new scheduler dependencies lists. (build_intra_loop_deps): Ditto. * target.h (struct _dep): Declare to use in gcc_target.sched.is_costly_dependence. (struct gcc_target.sched.adjust_cost): Fix typo. (struct gcc_target.sched.is_costly_dependence): Change signature to use single dep_t parameter instead of an equivalent triad. (struct gcc_target.sched.adjust_cost_2): Remove. * target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove. * reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments. * doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update documentation. (TARGET_SCHED_ADJUST_COST_2): Remove documentation. * doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler. (REG_DEP_TRUE): Document. * config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost. Change signature to correspond to the targetm.sched.adjust_cost hook. Update use in TARGET_SCHED_ADJUST_COST_2. (TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST. (ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use new scheduler dependencies lists. (ia64_gen_check): Ditto. * config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler dependencies lists. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change signature to correspond to the targetm.sched.is_costly_dependence hook. (is_costly_group): Update to use new scheduler dependencies lists. * config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function instead of INSN_COST () macro. From-SVN: r121494
2007-02-02 10:11:11 +01:00
gcc_assert (unused_listp != &unused_insn_list
|| GET_CODE (prev_link) == INSN_LIST);
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
while (link)
{
re PR middle-end/28071 (A file that can not be compiled in reasonable time/space) * sched-int.h (ds_to_dk, dk_to_ds): Declare functions. (struct _dep): New type. (dep_t): New typedef. (DEP_PRO, DEP_CON, DEP_KIND): New access macros. (DEP_STATUS): New access macro. The macro with the same name was renamed to DEP_LINK_STATUS. (dep_init): Declare function (struct _dep_link): New type. (dep_link_t): New typedef. (DEP_LINK_NODE, DEP_LINK_NEXT, DEP_LINK_PREV_NEXTP): New access macros. (DEP_LINK_DEP, DEP_LINK_PRO, DEP_LINK_CON, DEP_LINK_KIND): New macros. (DEP_LINK_STATUS): New macro. (debug_dep_links): New debug function. (struct _deps_list): New type. (deps_list_t): New typedef. (DEPS_LIST_FIRST): New access macro. (FOR_EACH_DEP_LINK): New cycle macro. (create_deps_list, free_deps_list, delete_deps_list): Declare functions. (deps_list_empty_p, debug_deps_list, add_back_dep_to_deps_list): Ditto. (find_link_by_pro_in_deps_list, find_link_by_con_in_deps_list): Ditto. (copy_deps_list_change_con): Ditto. (move_dep_link): Declare function. (struct _dep_node): New type. (dep_node_t): New typedef. (DEP_NODE_BACK, DEP_NODE_DEP, DEP_NODE_FORW): New access macros. (struct haifa_insn_data.back_deps): New field to hold backward dependencies of the insn. (struct haifa_insn_data.depend): Rename to forw_deps. Change its type to deps_list_t. (struct haifa_insn_data.resolved_deps): Rename to resolved_back_deps. Change its type to deps_list_t. (INSN_BACK_DEPS): New access macro to use instead of LOG_LINKS. (INSN_DEPEND): Rename to INSN_FORW_DEPS. (RESOLVED_DEPS): Rename to INSN_RESOLVED_BACK_DEPS. (INSN_COST): Move to haifa-sched.c. Use insn_cost () instead. (DEP_STATUS): Rename to DEP_LINK_STATUS. Fix typo in the comment. (add_forw_dep, delete_back_forw_dep, insn_cost): Update declaration and all callers. (dep_cost): Declare. * sched-deps.c (CHECK): New macro to (en/dis)able sanity checks. (ds_to_dk, dk_to_ds): New functions. (init_dep_1): New static function. (init_dep): New function. (copy_dep): New static function. (dep_link_consistent_p, attach_dep_link, add_to_deps_list): New static functions. (detach_dep_link): New static function. (move_dep_link): New function. (dep_links_consistent_p, dump_dep_links): New static functions. (debug_dep_links): New debugging function. (deps_obstack, dl_obstack, dn_obstack): New static variables. (alloc_deps_list, init_deps_list): New static functions. (create_deps_list): New function. (clear_deps_list): New static function. (free_deps_list, delete_deps_list, deps_list_empty_p): New functions. (deps_list_consistent_p, dump_deps_list): New static functions. (debug_deps_list): New function. (add_back_dep_to_deps_list, find_link_by_pro_in_deps_list): New functions. (find_link_by_con_in_deps_list, copy_deps_list_change_con): Ditto. (maybe_add_or_update_back_dep_1, add_or_update_back_dep_1): Update to use new scheduler dependencies lists. (add_back_dep, delete_all_dependences, fixup_sched_groups): Ditto. (sched_analyze): Ditto. Initialize dependencies lists. (add_forw_dep, compute_forward_dependences): Update to use new scheduler dependencies lists. (init_dependency_caches): Init deps_obstack. (free_dependency_caches): Free deps_obstack. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep): Update to use new scheduler dependencies lists. (delete_forw_dep, add_or_update_back_forw_dep): Ditto. (add_back_forw_dep, delete_back_forw_dep): Ditto. * sched-rgn.c (set_spec_fed, find_conditional_protection, is_pfree): Update to use new scheduler dependencies lists. (is_conditionally_protected, is_prisky, add_branch_dependences): Ditto. (debug_dependencies): Ditto. (schedule_region): Update comments. * sched-ebb.c (earliest_block_with_similiar_load): Update to use new scheduler dependencies lists. (schedule_ebb): Update comments. * rtl.def (DEPS_LIST): Remove. * lists.c (unused_deps_list): Remove. (free_list): Update assertions. (alloc_DEPS_LIST, free_DEPS_LIST_list, free_DEPS_LIST_node): Remove. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * rtl.h (free_DEPS_LIST_list, alloc_DEPS_LIST): Remove declarations. (remove_free_DEPS_LIST_elem, copy_DEPS_LIST_list): Ditto. * haifa-sched.c (comments): Update. (insn_cost1): Remove. Inline the code into insn_cost (). (insn_cost): Update to use new scheduler dependencies lists. Move processing of the dependency cost to dep_cost (). (dep_cost): New function. Use it instead of insn_cost () when evaluating cost of the dependency. Use compatible interface to interact with the target. (priority): Update to use new scheduler dependencies lists. (rank_for_schedule): Ditto. Optimize heuristic that prefers the insn with greater number of insns that depend on the insn. (schedule_insn): Update to use new scheduler dependencies lists. Add code to free backward dependencies lists. Inline and optimize code from resolve_dep () - see PR28071. (ok_for_early_queue_removal): Update to use new scheduler dependencies lists. Update call to targetm.sched.is_costly_dependence hook. (fix_inter_tick, try_ready, fix_tick_ready): Update to use new scheduler dependencies lists. (resolve_dep): Remove. Move the logic to schedule_insn (). (init_h_i_d): Initialize dependencies lists. (process_insn_depend_be_in_spec): Rename to process_insn_forw_deps_be_in_spec. Update to use new scheduler dependencies lists. (add_to_speculative_block, create_check_block_twin, fix_recovery_deps): Update to use new scheduler dependencies lists. (clear_priorities, calc_priorities, add_jump_dependencies): Ditto. * ddg.c (create_ddg_dependence, create_ddg_dep_no_link): Update to use new scheduler dependencies lists. (build_intra_loop_deps): Ditto. * target.h (struct _dep): Declare to use in gcc_target.sched.is_costly_dependence. (struct gcc_target.sched.adjust_cost): Fix typo. (struct gcc_target.sched.is_costly_dependence): Change signature to use single dep_t parameter instead of an equivalent triad. (struct gcc_target.sched.adjust_cost_2): Remove. * target-def.h (TARGET_SCHED_ADJUST_COST_2): Remove. * reg-notes.def (DEP_TRUE, DEP_OUTPUT, DEP_ANTI): Update comments. * doc/tm.texi (TARGET_SCHED_IS_COSTLY_DEPENDENCE): Update documentation. (TARGET_SCHED_ADJUST_COST_2): Remove documentation. * doc/rtl.texi (LOG_LINKS): Remove part about instruction scheduler. (REG_DEP_TRUE): Document. * config/ia64/ia64.c (ia64_adjust_cost_2): Rename to ia64_adjust_cost. Change signature to correspond to the targetm.sched.adjust_cost hook. Update use in TARGET_SCHED_ADJUST_COST_2. (TARGET_SCHED_ADJUST_COST_2): Rename to TARGET_SCHED_ADJUST_COST. (ia64_dependencies_evaluation_hook, ia64_dfa_new_cycle): Update to use new scheduler dependencies lists. (ia64_gen_check): Ditto. * config/mips/mips.c (vr4130_swap_insns_p): Update to use new scheduler dependencies lists. * config/rs6000/rs6000.c (rs6000_is_costly_dependence): Change signature to correspond to the targetm.sched.is_costly_dependence hook. (is_costly_group): Update to use new scheduler dependencies lists. * config/spu/spu.c (spu_sched_adjust_cost): Use insn_cost () function instead of INSN_COST () macro. From-SVN: r121494
2007-02-02 10:11:11 +01:00
gcc_assert (unused_listp != &unused_insn_list
|| GET_CODE (prev_link) == INSN_LIST);
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
prev_link = link;
link = XEXP (link, 1);
}
XEXP (prev_link, 1) = *unused_listp;
*unused_listp = *listp;
*listp = 0;
}
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
/* Find corresponding to ELEM node in the list pointed to by LISTP.
This node must exist in the list. Returns pointer to that node. */
static rtx *
find_list_elem (rtx elem, rtx *listp)
{
while (XEXP (*listp, 0) != elem)
listp = &XEXP (*listp, 1);
return listp;
}
/* Remove the node pointed to by LISTP from the list. */
static void
remove_list_node (rtx *listp)
{
rtx node;
node = *listp;
*listp = XEXP (node, 1);
XEXP (node, 1) = 0;
}
/* Removes corresponding to ELEM node from the list pointed to by LISTP.
Returns that node. */
sched-int.h (struct haifa_insn_data): New fields: resolved_deps, inter_tick, queue_index. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * sched-int.h (struct haifa_insn_data): New fields: resolved_deps, inter_tick, queue_index. (struct sched_info): Change signature of init_ready_list field. Adjust all initializations. (RESOLVED_DEPS): New access macro. (ready_add): Remove prototype. (try_ready): Add prototype. * sched-rgn.c (init_ready_list): Use try_ready. (schedule_region): Initialize current_sched_info->{sched_max_insns_priority, queue_must_finish_empty}. * sched-ebb.c (new_ready): Remove. Adjust ebb_sched_info. (init_ready_list): Use try_ready. (schedule_ebb): Initialize current_sched_info->sched_max_insns_priority. * lists.c (remove_list_elem): Remove `static'. (remove_free_INSN_LIST_elem): New function. * rtl.h (remove_list_elem, remove_free_INSN_LIST_elem): Add prototypes. * haifa-sched.c (INTER_TICK, QUEUE_INDEX): New macros. (INVALID_TICK, MIN_TICK, QUEUE_SCHEDULED, QUEUE_NOWHERE, QUEUE_READY): New constants. (readyp): New variable. (queue_remove, ready_remove_insn, fix_inter_tick, fix_tick_ready, change_queue_index, resolve_dep): New static functions. (try_ready): New function. Adjust callers in sched-rgn.c and sched-ebb.c to use it instead of ready_add. (clock_var): Move at the begining of file. (rank_for_schedule): Fix typo. (queue_insn): Add assertion. Handle QUEUE_INDEX. (ready_lastpos): Enforce assertion. (ready_add): Make it static. Handle QUEUE_INDEX. Add new argument, update all callers. (ready_remove_first, ready_remove): Handle QUEUE_INDEX. (schedule_insn): Rewrite to use try_ready and resolve_dep. (queue_to_ready): Use free_INSN_LIST_list. (early_queue_to_ready): Fix typo. (schedule_block): Init readyp. Move init_ready_list call after the initialization of clock_var. Fix error in rejecting insn by targetm.sched.dfa_new_cycle. Add call to fix_inter_tick. Remove code that previously corrected INSN_TICKs. Add code for handling QUEUE_INDEX. (set_priorities): Fix typo. (sched_init): Initialize INSN_TICK, INTER_TICK and QUEUE_INDEX. Clarify comment and code that keeps current_sched_info->next_tail non-null. From-SVN: r112127
2006-03-16 06:23:21 +01:00
rtx
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
remove_list_elem (rtx elem, rtx *listp)
{
rtx node;
listp = find_list_elem (elem, listp);
node = *listp;
remove_list_node (listp);
return node;
}
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
/* This call is used in place of a gen_rtx_INSN_LIST. If there is a cached
node available, we'll use it, otherwise a call to gen_rtx_INSN_LIST
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
is made. */
rtx
alloc_INSN_LIST (rtx val, rtx next)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
rtx r;
if (unused_insn_list)
{
r = unused_insn_list;
unused_insn_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
PUT_REG_NOTE_KIND (r, VOIDmode);
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
gcc_assert (GET_CODE (r) == INSN_LIST);
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
}
else
r = gen_rtx_INSN_LIST (VOIDmode, val, next);
return r;
}
/* This call is used in place of a gen_rtx_EXPR_LIST. If there is a cached
node available, we'll use it, otherwise a call to gen_rtx_EXPR_LIST
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
is made. */
rtx
alloc_EXPR_LIST (int kind, rtx val, rtx next)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
rtx r;
if (unused_expr_list)
{
r = unused_expr_list;
unused_expr_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
PUT_REG_NOTE_KIND (r, kind);
}
else
r = gen_rtx_EXPR_LIST (kind, val, next);
return r;
}
/* This function will free up an entire list of EXPR_LIST nodes. */
void
free_EXPR_LIST_list (rtx *listp)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
if (*listp == 0)
return;
free_list (listp, &unused_expr_list);
}
/* This function will free up an entire list of INSN_LIST nodes. */
void
free_INSN_LIST_list (rtx *listp)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
if (*listp == 0)
return;
free_list (listp, &unused_insn_list);
}
/* This function will free up an individual EXPR_LIST node. */
void
free_EXPR_LIST_node (rtx ptr)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
XEXP (ptr, 1) = unused_expr_list;
unused_expr_list = ptr;
}
/* This function will free up an individual INSN_LIST node. */
void
free_INSN_LIST_node (rtx ptr)
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
{
ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> Andrey Belevantsev <abel@ispras.ru> * ddg.c (build_intra_loop_deps): Adjust add_forward_dependence call. * lists.c (unused_deps_list): New variable. (free_list): Add assertions to verify the proper distinguishing between INSN_LISTs and DEPS_LISTs. (find_list_elem, remove_list_elem, remove_list_node): New static functions. (alloc_DEPS_LIST, free_DEPS_LIST, free_DEPS_LIST_node, remove_free_INSN_LIST_elem, remove_free_DEPS_LIST_elem, remove_free_INSN_LIST_node, remove_free_DEPS_LIST_node): New functions. (alloc_INSN_LIST): Assert that the list we're working on is indeed an INSN_LIST. (free_INSN_LIST_node): Likewise. * modulo-sched.c (current_sched_info): Initialize flags field. * reg-notes.def: Exchange DEP_ANTI and DEP_OUTPUT. * rtl.def (DEPS_LIST): Define. * rtl.h: Declare new functions from lists.c. * sched-deps.c (spec_dependency_cache): New static variable. (maybe_add_or_update_back_dep_1, add_back_dep): New static functions. (add_dependence): Change return type to void. Move the logic to ... (add_or_update_back_dep_1): ... here. Handle speculative dependencies. (delete_all_dependences): Add comment about forward_dependency_cache. Handle spec_dependency_cache. Handle DEPS_LISTs. (fixup_sched_groups): Clarify the change of priority of output and anti dependencies. (sched_analyze_2): Adjust add_dependence calls to create data speculative dependence. (add_forward_dependence): Renamed to add_forw_dep, change prototype. Adjust all callers. Handle DEPS_LISTS. (compute_forward_dependences): Use add_forw_dep. Sort LOG_LINKs in presence of speculation. (init_dependency_caches, free_dependency_caches): Handle spec_dependency_cache. (adjust_add_sorted_back_dep, adjust_back_add_forw_dep, delete_forw_dep, estimate_dep_weak, get_dep_weak, ds_merge, check_dep_status): New static functions. (add_or_update_back_dep, add_or_update_back_forw_dep, add_back_forw_dep, delete_back_forw_dep): New functions. * sched-int.h (ds_t, dw_t): New typedefs. (struct sched_info): Add new field flags. (struct haifa_insn_data): Add new bitfield has_internal_dep. Prototype new sched-deps.c functions. (HAS_INTERNAL_DEP, DEP_STATUS): New access macros. (BITS_PER_DEP_STATUS, BITS_PER_DEP_WEAK, DEP_WEAK_MASK, MAX_DEP_WEAK, MIN_DEP_WEAK, NO_DEP_WEAK, UNCERTAIN_DEP_WEAK, BEGIN_DATA, BE_IN_DATA, BEGIN_CONTROL, BE_IN_CONTROL, BEGIN_SPEC, DATA_SPEC, CONTROL_SPEC, SPECULATIVE, BE_IN_SPEC, FIRST_SPEC_TYPE, LAST_SPEC_TYPE, SPEC_TYPE_SHIFT, DEP_TRUE, DEP_OUTPUT, DEP_ANTI, DEP_TYPES, HARD_DEP): New constants. (enum SPEC_TYPES_OFFSETS, enum DEPS_ADJUST_RESULT, enum SCHED_FLAGS): New enums. * sched-rgn.c (current_sched_info): Initialize flags field. (schedule_insns): Initialize current_sched_info before the sched_init call. * sched-ebb.c (current_sched_info): Initialize flags field. (add_deps_for_risky_insns): Use control_flow_insn_p instead of JUMP_P. Call add_or_update_back_dep instead of add_dependence. Create control speculative dependencies. (schedule_insns): Initialize current_sched_info before the sched_init call. Co-Authored-By: Andrey Belevantsev <abel@ispras.ru> From-SVN: r112125
2006-03-16 06:17:41 +01:00
gcc_assert (GET_CODE (ptr) == INSN_LIST);
lists.c (unused_insn_list, [...]): New file for maintaining various types of lists. Wed Aug 25 13:41:47 EDT 1999 Andrew MacLeod <amacleod@cygnus.com> * lists.c (unused_insn_list, unused_expr_list): New file for maintaining various types of lists. New statics for maintaining a cache of available INSN_LIST and EXPR_LIST nodes. (free_list): Static function for freeing a list of INSN/EXPR nodes. (alloc_INSN_LIST): Function to get a free INSN_LIST node. (alloc_EXPR_LIST): Function to get a free EXPR_LIST node. (init_EXPR_INSN_LIST_cache): Initialize the cache lists. (free_EXPR_LIST_list): Free an entire list of EXPR_LIST nodes. (free_INSN_LIST_list): Free an entire list of INSN_LIST nodes. (free_EXPR_LIST_node): Free an individual EXPR_LIST node. (free_INSN_LIST_node): Free an individual INSN_LIST node. * haifa-sched.c (unused_insn_list, unused_expr_list): Moved to flow.c (free_list, alloc_INSN_LIST, alloc_EXPR_LIST): Moved to flow.c (remove_dependence, free_pending_lists): Use new global routines. (flush_pending_lists, sched_analyze_insn): Use new global routines. (sched_analyze, compute_block_backward_dependences): Use new routines. (sched_analyze_1, sched_analyze_2): Use new routines. (schedule_insns): Use new global routines. * rtl.h (init_EXPR_INSN_LIST_cache, free_EXPR_LIST_list): Add function prototypes. (free_INSN_LIST_list, free_EXPR_LIST_node): Add prototypes. (free_INSN_LIST_node, alloc_INSN_LIST, alloc_EXPR_LIST): Add function prototypes. * toplev.c (rest_of_compilation): Initialize node cache. * Makefile.in (OBJS): Add lists.o to list of object files. (lists.o): Add dependancies. From-SVN: r28864
1999-08-25 19:50:53 +02:00
XEXP (ptr, 1) = unused_insn_list;
unused_insn_list = ptr;
}
sched-int.h (struct haifa_insn_data): New fields: resolved_deps, inter_tick, queue_index. 2006-03-16 Maxim Kuvyrkov <mkuvyrkov@ispras.ru> * sched-int.h (struct haifa_insn_data): New fields: resolved_deps, inter_tick, queue_index. (struct sched_info): Change signature of init_ready_list field. Adjust all initializations. (RESOLVED_DEPS): New access macro. (ready_add): Remove prototype. (try_ready): Add prototype. * sched-rgn.c (init_ready_list): Use try_ready. (schedule_region): Initialize current_sched_info->{sched_max_insns_priority, queue_must_finish_empty}. * sched-ebb.c (new_ready): Remove. Adjust ebb_sched_info. (init_ready_list): Use try_ready. (schedule_ebb): Initialize current_sched_info->sched_max_insns_priority. * lists.c (remove_list_elem): Remove `static'. (remove_free_INSN_LIST_elem): New function. * rtl.h (remove_list_elem, remove_free_INSN_LIST_elem): Add prototypes. * haifa-sched.c (INTER_TICK, QUEUE_INDEX): New macros. (INVALID_TICK, MIN_TICK, QUEUE_SCHEDULED, QUEUE_NOWHERE, QUEUE_READY): New constants. (readyp): New variable. (queue_remove, ready_remove_insn, fix_inter_tick, fix_tick_ready, change_queue_index, resolve_dep): New static functions. (try_ready): New function. Adjust callers in sched-rgn.c and sched-ebb.c to use it instead of ready_add. (clock_var): Move at the begining of file. (rank_for_schedule): Fix typo. (queue_insn): Add assertion. Handle QUEUE_INDEX. (ready_lastpos): Enforce assertion. (ready_add): Make it static. Handle QUEUE_INDEX. Add new argument, update all callers. (ready_remove_first, ready_remove): Handle QUEUE_INDEX. (schedule_insn): Rewrite to use try_ready and resolve_dep. (queue_to_ready): Use free_INSN_LIST_list. (early_queue_to_ready): Fix typo. (schedule_block): Init readyp. Move init_ready_list call after the initialization of clock_var. Fix error in rejecting insn by targetm.sched.dfa_new_cycle. Add call to fix_inter_tick. Remove code that previously corrected INSN_TICKs. Add code for handling QUEUE_INDEX. (set_priorities): Fix typo. (sched_init): Initialize INSN_TICK, INTER_TICK and QUEUE_INDEX. Clarify comment and code that keeps current_sched_info->next_tail non-null. From-SVN: r112127
2006-03-16 06:23:21 +01:00
/* Remove and free corresponding to ELEM node in the INSN_LIST pointed to
by LISTP. */
void
remove_free_INSN_LIST_elem (rtx elem, rtx *listp)
{
free_INSN_LIST_node (remove_list_elem (elem, listp));
}
#include "gt-lists.h"