gcc/gcc/lists.c

246 lines
6.1 KiB
C
Raw Normal View History

/* List management for the GCC expander.
Copyright (C) 1987-2017 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 3, or (at your option) any later
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
version.
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
along with GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
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 "rtl.h"
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);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +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);
Remove trailing white spaces. 2009-11-25 H.J. Lu <hongjiu.lu@intel.com> * alias.c: Remove trailing white spaces. * alloc-pool.c: Likewise. * alloc-pool.h: Likewise. * attribs.c: Likewise. * auto-inc-dec.c: Likewise. * basic-block.h: Likewise. * bb-reorder.c: Likewise. * bt-load.c: Likewise. * builtins.c: Likewise. * builtins.def: Likewise. * c-common.c: Likewise. * c-common.h: Likewise. * c-cppbuiltin.c: Likewise. * c-decl.c: Likewise. * c-format.c: Likewise. * c-lex.c: Likewise. * c-omp.c: Likewise. * c-opts.c: Likewise. * c-parser.c: Likewise. * c-pretty-print.c: Likewise. * c-tree.h: Likewise. * c-typeck.c: Likewise. * caller-save.c: Likewise. * calls.c: Likewise. * cfg.c: Likewise. * cfganal.c: Likewise. * cfgexpand.c: Likewise. * cfghooks.c: Likewise. * cfghooks.h: Likewise. * cfglayout.c: Likewise. * cfgloop.c: Likewise. * cfgloop.h: Likewise. * cfgloopmanip.c: Likewise. * cfgrtl.c: Likewise. * cgraph.c: Likewise. * cgraph.h: Likewise. * cgraphbuild.c: Likewise. * cgraphunit.c: Likewise. * cif-code.def: Likewise. * collect2.c: Likewise. * combine.c: Likewise. * convert.c: Likewise. * coverage.c: Likewise. * crtstuff.c: Likewise. * cse.c: Likewise. * cselib.c: Likewise. * dbgcnt.c: Likewise. * dbgcnt.def: Likewise. * dbgcnt.h: Likewise. * dbxout.c: Likewise. * dce.c: Likewise. * ddg.c: Likewise. * ddg.h: Likewise. * defaults.h: Likewise. * df-byte-scan.c: Likewise. * df-core.c: Likewise. * df-problems.c: Likewise. * df-scan.c: Likewise. * df.h: Likewise. * dfp.c: Likewise. * diagnostic.c: Likewise. * diagnostic.h: Likewise. * dominance.c: Likewise. * domwalk.c: Likewise. * double-int.c: Likewise. * double-int.h: Likewise. * dse.c: Likewise. * dwarf2asm.c: Likewise. * dwarf2asm.h: Likewise. * dwarf2out.c: Likewise. * ebitmap.c: Likewise. * ebitmap.h: Likewise. * emit-rtl.c: Likewise. * et-forest.c: Likewise. * except.c: Likewise. * except.h: Likewise. * expmed.c: Likewise. * expr.c: Likewise. * expr.h: Likewise. * final.c: Likewise. * flags.h: Likewise. * fold-const.c: Likewise. * function.c: Likewise. * function.h: Likewise. * fwprop.c: Likewise. * gcc.c: Likewise. * gcov-dump.c: Likewise. * gcov-io.c: Likewise. * gcov-io.h: Likewise. * gcov.c: Likewise. * gcse.c: Likewise. * genattr.c: Likewise. * genattrtab.c: Likewise. * genautomata.c: Likewise. * genchecksum.c: Likewise. * genconfig.c: Likewise. * genflags.c: Likewise. * gengtype-parse.c: Likewise. * gengtype.c: Likewise. * gengtype.h: Likewise. * genmddeps.c: Likewise. * genmodes.c: Likewise. * genopinit.c: Likewise. * genpreds.c: Likewise. * gensupport.c: Likewise. * ggc-common.c: Likewise. * ggc-page.c: Likewise. * ggc-zone.c: Likewise. * ggc.h: Likewise. * gimple-iterator.c: Likewise. * gimple-low.c: Likewise. * gimple-pretty-print.c: Likewise. * gimple.c: Likewise. * gimple.def: Likewise. * gimple.h: Likewise. * gimplify.c: Likewise. * graphds.c: Likewise. * graphite-clast-to-gimple.c: Likewise. * gthr-nks.h: Likewise. * gthr-posix.c: Likewise. * gthr-posix.h: Likewise. * gthr-posix95.h: Likewise. * gthr-single.h: Likewise. * gthr-tpf.h: Likewise. * gthr-vxworks.h: Likewise. * gthr.h: Likewise. * haifa-sched.c: Likewise. * hard-reg-set.h: Likewise. * hooks.c: Likewise. * hooks.h: Likewise. * hosthooks.h: Likewise. * hwint.h: Likewise. * ifcvt.c: Likewise. * incpath.c: Likewise. * init-regs.c: Likewise. * integrate.c: Likewise. * ipa-cp.c: Likewise. * ipa-inline.c: Likewise. * ipa-prop.c: Likewise. * ipa-pure-const.c: Likewise. * ipa-reference.c: Likewise. * ipa-struct-reorg.c: Likewise. * ipa-struct-reorg.h: Likewise. * ipa-type-escape.c: Likewise. * ipa-type-escape.h: Likewise. * ipa-utils.c: Likewise. * ipa-utils.h: Likewise. * ipa.c: Likewise. * ira-build.c: Likewise. * ira-color.c: Likewise. * ira-conflicts.c: Likewise. * ira-costs.c: Likewise. * ira-emit.c: Likewise. * ira-int.h: Likewise. * ira-lives.c: Likewise. * ira.c: Likewise. * jump.c: Likewise. * lambda-code.c: Likewise. * lambda-mat.c: Likewise. * lambda-trans.c: Likewise. * lambda.h: Likewise. * langhooks.c: Likewise. * lcm.c: Likewise. * libgcov.c: Likewise. * lists.c: Likewise. * loop-doloop.c: Likewise. * loop-init.c: Likewise. * loop-invariant.c: Likewise. * loop-iv.c: Likewise. * loop-unroll.c: Likewise. * lower-subreg.c: Likewise. * lto-cgraph.c: Likewise. * lto-compress.c: Likewise. * lto-opts.c: Likewise. * lto-section-in.c: Likewise. * lto-section-out.c: Likewise. * lto-streamer-in.c: Likewise. * lto-streamer-out.c: Likewise. * lto-streamer.c: Likewise. * lto-streamer.h: Likewise. * lto-symtab.c: Likewise. * lto-wpa-fixup.c: Likewise. * matrix-reorg.c: Likewise. * mcf.c: Likewise. * mode-switching.c: Likewise. * modulo-sched.c: Likewise. * omega.c: Likewise. * omega.h: Likewise. * omp-low.c: Likewise. * optabs.c: Likewise. * optabs.h: Likewise. * opts-common.c: Likewise. * opts.c: Likewise. * params.def: Likewise. * params.h: Likewise. * passes.c: Likewise. * plugin.c: Likewise. * postreload-gcse.c: Likewise. * postreload.c: Likewise. * predict.c: Likewise. * predict.def: Likewise. * pretty-print.c: Likewise. * pretty-print.h: Likewise. * print-rtl.c: Likewise. * print-tree.c: Likewise. * profile.c: Likewise. * read-rtl.c: Likewise. * real.c: Likewise. * recog.c: Likewise. * reg-stack.c: Likewise. * regcprop.c: Likewise. * reginfo.c: Likewise. * regmove.c: Likewise. * regrename.c: Likewise. * regs.h: Likewise. * regstat.c: Likewise. * reload.c: Likewise. * reload1.c: Likewise. * resource.c: Likewise. * rtl.c: Likewise. * rtl.def: Likewise. * rtl.h: Likewise. * rtlanal.c: Likewise. * sbitmap.c: Likewise. * sched-deps.c: Likewise. * sched-ebb.c: Likewise. * sched-int.h: Likewise. * sched-rgn.c: Likewise. * sched-vis.c: Likewise. * sdbout.c: Likewise. * sel-sched-dump.c: Likewise. * sel-sched-dump.h: Likewise. * sel-sched-ir.c: Likewise. * sel-sched-ir.h: Likewise. * sel-sched.c: Likewise. * sel-sched.h: Likewise. * sese.c: Likewise. * sese.h: Likewise. * simplify-rtx.c: Likewise. * stack-ptr-mod.c: Likewise. * stmt.c: Likewise. * stor-layout.c: Likewise. * store-motion.c: Likewise. * stringpool.c: Likewise. * stub-objc.c: Likewise. * sync-builtins.def: Likewise. * target-def.h: Likewise. * target.h: Likewise. * targhooks.c: Likewise. * targhooks.h: Likewise. * timevar.c: Likewise. * tlink.c: Likewise. * toplev.c: Likewise. * toplev.h: Likewise. * tracer.c: Likewise. * tree-affine.c: Likewise. * tree-affine.h: Likewise. * tree-browser.def: Likewise. * tree-call-cdce.c: Likewise. * tree-cfg.c: Likewise. * tree-cfgcleanup.c: Likewise. * tree-chrec.c: Likewise. * tree-chrec.h: Likewise. * tree-complex.c: Likewise. * tree-data-ref.c: Likewise. * tree-data-ref.h: Likewise. * tree-dfa.c: Likewise. * tree-dump.c: Likewise. * tree-dump.h: Likewise. * tree-eh.c: Likewise. * tree-flow-inline.h: Likewise. * tree-flow.h: Likewise. * tree-if-conv.c: Likewise. * tree-inline.c: Likewise. * tree-into-ssa.c: Likewise. * tree-loop-distribution.c: Likewise. * tree-loop-linear.c: Likewise. * tree-mudflap.c: Likewise. * tree-nested.c: Likewise. * tree-nomudflap.c: Likewise. * tree-nrv.c: Likewise. * tree-object-size.c: Likewise. * tree-optimize.c: Likewise. * tree-outof-ssa.c: Likewise. * tree-parloops.c: Likewise. * tree-pass.h: Likewise. * tree-phinodes.c: Likewise. * tree-predcom.c: Likewise. * tree-pretty-print.c: Likewise. * tree-profile.c: Likewise. * tree-scalar-evolution.c: Likewise. * tree-ssa-address.c: Likewise. * tree-ssa-alias.c: Likewise. * tree-ssa-ccp.c: Likewise. * tree-ssa-coalesce.c: Likewise. * tree-ssa-copy.c: Likewise. * tree-ssa-copyrename.c: Likewise. * tree-ssa-dce.c: Likewise. * tree-ssa-dom.c: Likewise. * tree-ssa-dse.c: Likewise. * tree-ssa-forwprop.c: Likewise. * tree-ssa-ifcombine.c: Likewise. * tree-ssa-live.c: Likewise. * tree-ssa-live.h: Likewise. * tree-ssa-loop-ch.c: Likewise. * tree-ssa-loop-im.c: Likewise. * tree-ssa-loop-ivcanon.c: Likewise. * tree-ssa-loop-ivopts.c: Likewise. * tree-ssa-loop-manip.c: Likewise. * tree-ssa-loop-niter.c: Likewise. * tree-ssa-loop-prefetch.c: Likewise. * tree-ssa-loop-unswitch.c: Likewise. * tree-ssa-loop.c: Likewise. * tree-ssa-math-opts.c: Likewise. * tree-ssa-operands.c: Likewise. * tree-ssa-operands.h: Likewise. * tree-ssa-phiopt.c: Likewise. * tree-ssa-phiprop.c: Likewise. * tree-ssa-pre.c: Likewise. * tree-ssa-propagate.c: Likewise. * tree-ssa-reassoc.c: Likewise. * tree-ssa-sccvn.c: Likewise. * tree-ssa-sink.c: Likewise. * tree-ssa-structalias.c: Likewise. * tree-ssa-ter.c: Likewise. * tree-ssa-threadedge.c: Likewise. * tree-ssa-threadupdate.c: Likewise. * tree-ssa-uncprop.c: Likewise. * tree-ssa.c: Likewise. * tree-ssanames.c: Likewise. * tree-switch-conversion.c: Likewise. * tree-tailcall.c: Likewise. * tree-vect-data-refs.c: Likewise. * tree-vect-generic.c: Likewise. * tree-vect-loop-manip.c: Likewise. * tree-vect-loop.c: Likewise. * tree-vect-patterns.c: Likewise. * tree-vect-slp.c: Likewise. * tree-vect-stmts.c: Likewise. * tree-vectorizer.c: Likewise. * tree-vectorizer.h: Likewise. * tree-vrp.c: Likewise. * tree.c: Likewise. * tree.def: Likewise. * tree.h: Likewise. * treestruct.def: Likewise. * unwind-compat.c: Likewise. * unwind-dw2-fde-glibc.c: Likewise. * unwind-dw2.c: Likewise. * value-prof.c: Likewise. * value-prof.h: Likewise. * var-tracking.c: Likewise. * varasm.c: Likewise. * varpool.c: Likewise. * vec.c: Likewise. * vec.h: Likewise. * vmsdbgout.c: Likewise. * web.c: Likewise. * xcoffout.c: Likewise. From-SVN: r154645
2009-11-25 11:55:54 +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. */
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *
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
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *r;
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 (unused_insn_list)
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
r = as_a <rtx_insn_list *> (unused_insn_list);
unused_insn_list = r->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
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. */
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
rtx_expr_list *
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
{
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
rtx_expr_list *r;
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 (unused_expr_list)
{
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
r = as_a <rtx_expr_list *> (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
unused_expr_list = XEXP (r, 1);
XEXP (r, 0) = val;
XEXP (r, 1) = next;
PUT_REG_NOTE_KIND (r, kind);
}
else
decl.c, [...]: Remove redundant enum from machine_mode. gcc/ada/ * gcc-interface/decl.c, gcc-interface/gigi.h, gcc-interface/misc.c, gcc-interface/trans.c, gcc-interface/utils.c, gcc-interface/utils2.c: Remove redundant enum from machine_mode. gcc/c-family/ * c-common.c, c-common.h, c-cppbuiltin.c, c-lex.c: Remove redundant enum from machine_mode. gcc/c/ * c-decl.c, c-tree.h, c-typeck.c: Remove redundant enum from machine_mode. gcc/cp/ * constexpr.c: Remove redundant enum from machine_mode. gcc/fortran/ * trans-types.c, trans-types.h: Remove redundant enum from machine_mode. gcc/go/ * go-lang.c: Remove redundant enum from machine_mode. gcc/java/ * builtins.c, java-tree.h, typeck.c: Remove redundant enum from machine_mode. gcc/lto/ * lto-lang.c: Remove redundant enum from machine_mode. gcc/ * addresses.h, alias.c, asan.c, auto-inc-dec.c, bt-load.c, builtins.c, builtins.h, caller-save.c, calls.c, calls.h, cfgexpand.c, cfgloop.h, cfgrtl.c, combine.c, compare-elim.c, config/aarch64/aarch64-builtins.c, config/aarch64/aarch64-protos.h, config/aarch64/aarch64-simd.md, config/aarch64/aarch64.c, config/aarch64/aarch64.h, config/aarch64/aarch64.md, config/alpha/alpha-protos.h, config/alpha/alpha.c, config/arc/arc-protos.h, config/arc/arc.c, config/arc/arc.h, config/arc/predicates.md, config/arm/aarch-common-protos.h, config/arm/aarch-common.c, config/arm/arm-protos.h, config/arm/arm.c, config/arm/arm.h, config/arm/arm.md, config/arm/neon.md, config/arm/thumb2.md, config/avr/avr-log.c, config/avr/avr-protos.h, config/avr/avr.c, config/avr/avr.md, config/bfin/bfin-protos.h, config/bfin/bfin.c, config/c6x/c6x-protos.h, config/c6x/c6x.c, config/c6x/c6x.md, config/cr16/cr16-protos.h, config/cr16/cr16.c, config/cris/cris-protos.h, config/cris/cris.c, config/cris/cris.md, config/darwin-protos.h, config/darwin.c, config/epiphany/epiphany-protos.h, config/epiphany/epiphany.c, config/epiphany/epiphany.md, config/fr30/fr30.c, config/frv/frv-protos.h, config/frv/frv.c, config/frv/predicates.md, config/h8300/h8300-protos.h, config/h8300/h8300.c, config/i386/i386-builtin-types.awk, config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.md, config/i386/predicates.md, config/i386/sse.md, config/i386/sync.md, config/ia64/ia64-protos.h, config/ia64/ia64.c, config/iq2000/iq2000-protos.h, config/iq2000/iq2000.c, config/iq2000/iq2000.md, config/lm32/lm32-protos.h, config/lm32/lm32.c, config/m32c/m32c-protos.h, config/m32c/m32c.c, config/m32r/m32r-protos.h, config/m32r/m32r.c, config/m68k/m68k-protos.h, config/m68k/m68k.c, config/mcore/mcore-protos.h, config/mcore/mcore.c, config/mcore/mcore.md, config/mep/mep-protos.h, config/mep/mep.c, config/microblaze/microblaze-protos.h, config/microblaze/microblaze.c, config/mips/mips-protos.h, config/mips/mips.c, config/mmix/mmix-protos.h, config/mmix/mmix.c, config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c, config/moxie/moxie.c, config/msp430/msp430-protos.h, config/msp430/msp430.c, config/nds32/nds32-cost.c, config/nds32/nds32-intrinsic.c, config/nds32/nds32-md-auxiliary.c, config/nds32/nds32-protos.h, config/nds32/nds32.c, config/nios2/nios2-protos.h, config/nios2/nios2.c, config/pa/pa-protos.h, config/pa/pa.c, config/pdp11/pdp11-protos.h, config/pdp11/pdp11.c, config/rl78/rl78-protos.h, config/rl78/rl78.c, config/rs6000/altivec.md, config/rs6000/rs6000-c.c, config/rs6000/rs6000-protos.h, config/rs6000/rs6000.c, config/rs6000/rs6000.h, config/rx/rx-protos.h, config/rx/rx.c, config/s390/predicates.md, config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h, config/s390/s390.md, config/sh/predicates.md, config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.md, config/sparc/predicates.md, config/sparc/sparc-protos.h, config/sparc/sparc.c, config/sparc/sparc.md, config/spu/spu-protos.h, config/spu/spu.c, config/stormy16/stormy16-protos.h, config/stormy16/stormy16.c, config/tilegx/tilegx-protos.h, config/tilegx/tilegx.c, config/tilegx/tilegx.md, config/tilepro/tilepro-protos.h, config/tilepro/tilepro.c, config/v850/v850-protos.h, config/v850/v850.c, config/v850/v850.md, config/vax/vax-protos.h, config/vax/vax.c, config/vms/vms-c.c, config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c, coverage.c, cprop.c, cse.c, cselib.c, cselib.h, dbxout.c, ddg.c, df-problems.c, dfp.c, dfp.h, doc/md.texi, doc/rtl.texi, doc/tm.texi, doc/tm.texi.in, dojump.c, dse.c, dwarf2cfi.c, dwarf2out.c, dwarf2out.h, emit-rtl.c, emit-rtl.h, except.c, explow.c, expmed.c, expmed.h, expr.c, expr.h, final.c, fixed-value.c, fixed-value.h, fold-const.c, function.c, function.h, fwprop.c, gcse.c, gengenrtl.c, genmodes.c, genopinit.c, genoutput.c, genpreds.c, genrecog.c, gensupport.c, gimple-ssa-strength-reduction.c, graphite-clast-to-gimple.c, haifa-sched.c, hooks.c, hooks.h, ifcvt.c, internal-fn.c, ira-build.c, ira-color.c, ira-conflicts.c, ira-costs.c, ira-emit.c, ira-int.h, ira-lives.c, ira.c, ira.h, jump.c, langhooks.h, libfuncs.h, lists.c, loop-doloop.c, loop-invariant.c, loop-iv.c, loop-unroll.c, lower-subreg.c, lower-subreg.h, lra-assigns.c, lra-constraints.c, lra-eliminations.c, lra-int.h, lra-lives.c, lra-spills.c, lra.c, lra.h, machmode.h, omp-low.c, optabs.c, optabs.h, output.h, postreload.c, print-tree.c, read-rtl.c, real.c, real.h, recog.c, recog.h, ree.c, reg-stack.c, regcprop.c, reginfo.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, rtl.c, rtl.h, rtlanal.c, rtlhash.c, rtlhooks-def.h, rtlhooks.c, sched-deps.c, sel-sched-dump.c, sel-sched-ir.c, sel-sched-ir.h, sel-sched.c, simplify-rtx.c, stmt.c, stor-layout.c, stor-layout.h, target.def, targhooks.c, targhooks.h, tree-affine.c, tree-call-cdce.c, tree-complex.c, tree-data-ref.c, tree-dfa.c, tree-if-conv.c, tree-inline.c, tree-outof-ssa.c, tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-ccp.c, tree-ssa-loop-ivopts.c, tree-ssa-loop-ivopts.h, tree-ssa-loop-manip.c, tree-ssa-loop-prefetch.c, tree-ssa-math-opts.c, tree-ssa-reassoc.c, tree-ssa-sccvn.c, tree-streamer-in.c, tree-switch-conversion.c, tree-vect-data-refs.c, tree-vect-generic.c, tree-vect-loop.c, tree-vect-patterns.c, tree-vect-slp.c, tree-vect-stmts.c, tree-vrp.c, tree.c, tree.h, tsan.c, ubsan.c, valtrack.c, var-tracking.c, varasm.c: Remove redundant enum from machine_mode. gcc/ * gengtype.c (main): Treat machine_mode as a scalar typedef. * genmodes.c (emit_insn_modes_h): Hide inline functions if USED_FOR_TARGET. From-SVN: r216834
2014-10-29 13:02:45 +01:00
r = gen_rtx_EXPR_LIST ((machine_mode) kind, val, 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
return r;
}
/* This function will free up an entire list of EXPR_LIST nodes. */
void
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
free_EXPR_LIST_list (rtx_expr_list **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;
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
free_list ((rtx *)listp, &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
}
/* This function will free up an entire list of INSN_LIST nodes. */
void
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
free_INSN_LIST_list (rtx_insn_list **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;
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
free_list ((rtx *)listp, &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
}
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
/* Make a copy of the INSN_LIST list LINK and return it. */
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *
copy_INSN_LIST (rtx_insn_list *link)
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *new_queue;
rtx_insn_list **pqueue = &new_queue;
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
for (; link; link = link->next ())
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn *x = link->insn ();
rtx_insn_list *newlink = alloc_INSN_LIST (x, NULL);
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
*pqueue = newlink;
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
pqueue = (rtx_insn_list **)&XEXP (newlink, 1);
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
}
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
*pqueue = NULL;
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
return new_queue;
}
/* Duplicate the INSN_LIST elements of COPY and prepend them to OLD. */
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *
concat_INSN_LIST (rtx_insn_list *copy, rtx_insn_list *old)
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *new_rtx = old;
for (; copy ; copy = copy->next ())
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
new_rtx = alloc_INSN_LIST (copy->insn (), new_rtx);
reg-notes.def (DEP_CONTROL): New. * reg-notes.def (DEP_CONTROL): New. * sched-ebb.c (add_deps_for_risky_insns): Add a REG_DEP_CONTROL when not doing speculation. * rtlanal.c (record_hard_reg_sets, find_all_hard_reg_sets, record_hard_reg_uses_1, record_hard_reg_uses): New functions. * function.c (record_hard_reg_sets, record_hard_reg_uses, record_hard_reg_uses_1): Remove; move to rtlanal.c. * lists.c (copy_INSN_LIST, concat_INSN_LIST): New functions. * haifa-sched.c: Swap includes of "rtl.h" and "hard-reg-set.h". (MUST_RECOMPUTE_SPEC_P): New macro. (real_insn_for_shadow): New function. (cond_clobbered_p, recompute_todo_spec, check_clobbered_conditions, toggle_cancelled_flags): New static functions. (schedule_insn): Relax an assert to only check for empty hard back dependencies. Skip cancelled dependencies. Call check_clobbered_conditions. (copy_insn_list): Remove function, renamed moved to lists.c. (save_backtrack_point): Use new spelling copy_INSN_LIST. (unschedule_insns_until): Ensure TODO_SPEC is reset properly. (restore_last_backtrack_point): Likewise. Call toggle_cancelled_flags. (estimate_insn_tick): Ignore cancelled dependencies. (haifa_speculate_insn): Move declaration. (try_ready): Move code into recompute_todo_spec and call it. Tweak some asserts. Ensure predicated patterns are restored if necessary. Dump DEP_CONTROL flag. (haifa_change_pattern): Merge with sched_change_pattern. (sched_change_pattern): Remove function. * sched-deps.c (NON_FLUSH_JUMP_KIND, NON_FLUSH_JUMP): Remove. All uses changed to simply not test NON_FLUSH_JUMP_P. (ds_to_dk, dk_to_ds, dump_dep, ds_to_dt, dump_ds, check_dep): Handle REG_DEP_CONTROL. (dep_spec_p): If DO_PREDICATION, REG_DEP_CONTROL is speculative. (reg_pending_control_uses, control_dependency_cache): New static variables. (sched_get_reverse_condition_uncached): New function. (sd_find_dep_between): Remove pointless assert. Look in control_dependency_cache. (ask_dependency_caches, set_dependency_caches, sd_delete_dep, extend_dependency_caches, sched_deps_finish): Handle REG_DEP_CONTROL and control_dependency_cache. (sd_unresolve_dep): Use dep_spec_p. (add_dependence): Now a wrapper around add_dependence_1, handling REG_DEP_CONTROL specially. (flush_pending_lists): Clear pending_jump_insns. (sched_analyze_1): Handle pending_jump_insns like a memory flush. (sched_analyze_2): Unconditionally add to pending memory flushes, keep previous behaviour but apply it to pending_jump_insns instead. (sched_analyze_insn): Defer adding jump reg dependencies using reg_pending_control_uses; add them to the control_uses list. Handle pending_jump_insns and control_uses when adding dependence lists. (deps_analyze_insn): Update INSN_COND_DEPS. (deps_analyze_insn): Add jumps to pending_jump_insns rather than last_pending_memory_flush. (init_deps): Initialize pending_jump_insns. (free_deps): Free control_uses. (remove_from_deps): Remove from pending_jump_insns. (init_deps_global): Allocate reg_pending_control_uses). (finish_deps_global): Free it. (add_dependence_1): Renamed from add_dependence. Handle REG_DEP_CONTROL. * rtl.h (record_hard_reg_uses, find_all_hard_reg_sets): Declare. (copy_INSN_LIST, concat_INSN_LIST): Declare. * sched-int.h (struct deps_reg): Add control_uses. (struct deps_desc): Add pending_jump_insns. (struct _haifa_deps_insn_data): Add cond_deps. (struct _haifa_insn_data): Add must_recompute_spec and predicated_pat. (INSN_COND_DEPS, PREDICATED_PAT): New macros. (BITS_PER_DEP_WEAK): Adjust for two extra bits in the word. (DEP_CONTROL): New macro. (DEP_TYPES): Include it. (HARD_DEP): Adjust definition. (DEP_CANCELLED): New macro. (enum SCHED_FLAGS): Add DO_PREDICATION. (sched_get_reverse_condition_uncached, real_insn_for_shadow): Declare. * sched-rgn.c (concat_INSN_LIST): Remove function. (deps_join): Handle pending_jump_insns. (free_pending_lists): Likewise. * config/c6x/c6x.c (c6x_set_sched_flags): Set DO_PREDICATION for final schedule. From-SVN: r180302
2011-10-21 15:35:44 +02:00
PUT_REG_NOTE_KIND (new_rtx, REG_NOTE_KIND (copy));
}
return new_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
/* 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
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
remove_free_INSN_LIST_elem (rtx_insn *elem, rtx_insn_list **listp)
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
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
free_INSN_LIST_node (remove_list_elem (elem, (rtx *)listp));
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
}
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
/* Remove and free the first node in the INSN_LIST pointed to by LISTP. */
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn *
remove_free_INSN_LIST_node (rtx_insn_list **listp)
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
{
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
rtx_insn_list *node = *listp;
rtx_insn *elem = node->insn ();
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
Use rtx_insn_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_INSN_LIST_list): Strengthen param from rtx * to rtx_insn_list **. (alloc_INSN_LIST): Strengthen return type from rtx to rtx_insn_list *. (copy_INSN_LIST): Likewise for return type and param. (concat_INSN_LIST): Likewise for both params and return type. (remove_free_INSN_LIST_elem): Strenghten first param from rtx to rtx_insn *. Strengthen second param from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strenghten return type from rtx to rtx_insn *. Strengthen param from rtx * to rtx_insn_list **. * sched-int.h (struct deps_reg): Strengthen fields "uses", "sets", "implicit_sets", "control_uses", "clobbers" from rtx to rtx_insn_list *. (struct deps_desc): Likewise for fields "pending_read_insns", "pending_write_insns", "pending_jump_insns", "last_pending_memory_flush", "last_function_call", "last_function_call_may_noreturn", "sched_before_next_call", "sched_before_next_jump". (struct _haifa_deps_insn_data): Likewise for field "cond_deps". (remove_from_deps): Strengthen second param from rtx to rtx_insn *. * gcse.c (struct ls_expr): Strengthen fields "loads" and "stores" from rtx to rtx_insn_list *. (ldst_entry): Replace use of NULL_RTX with NULL when dealing with rtx_insn_list *. * haifa-sched.c (insn_queue): Strengthen this variable from rtx * to rtx_insn_list **. (dep_cost_1): Strengthen local "dep_cost_rtx_link" from rtx to rtx_insn_list *. (queue_insn): Likewise for local "link". (struct haifa_saved_data): Strengthen field "insn_queue" from rtx * to rtx_insn_list **. (save_backtrack_point): Update allocation of save->insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. (queue_to_ready): Strengthen local "link" from rtx to rtx_insn_list *; use methods "next" and "insn" when traversing the list. (early_queue_to_ready): Likewise for locals "link", "next_link", "prev_link". (schedule_block): Update allocation of insn_queue to reflect the strengthening of elements from rtx to rtx_insn_list *. Strengthen local "link" from rtx to rtx_insn_list *, and use methods when working it. (add_to_speculative_block): Strengthen locals "twins" and "next_node" from rtx to rtx_insn_list *, and use methods when working with them. Strengthen local "twin" from rtx to rtx_insn *, eliminating a checked cast. (fix_recovery_deps): Strengthen locals "ready_list" and "link" from rtx to rtx_insn_list *, and use methods when working with them. * lists.c (alloc_INSN_LIST): Strengthen return type and local "r" from rtx to rtx_insn_list *, adding a checked cast. (free_INSN_LIST_list): Strengthen param "listp" from rtx * to rtx_insn_list **. (copy_INSN_LIST): Strengthen return type and locals "new_queue", "newlink" from rtx to rtx_insn_list *. Strengthen local "pqueue" from rtx * to rtx_insn_list **. Strengthen local "x" from rtx to rtx_insn *. (concat_INSN_LIST): Strengthen return type and local "new_rtx", from rtx to rtx_insn_list *. Use methods of the latter class. (remove_free_INSN_LIST_elem): Strengthen param "elem" from rtx to rtx_insn *, and param "listp" from rtx * to rtx_insn_list **. (remove_free_INSN_LIST_node): Strengthen return type and local "elem" from rtx to rtx_insn *. Strenghten param "listp" from rtx * to rtx_insn_list **. Strengthen local "node" from rtx to rtx_insn_list *, using "insn" method. * sched-deps.c (add_dependence_list): Strengthen param "list" from rtx to rtx_insn_list *, and use methods when working with it. (add_dependence_list_and_free): Strengthen param "listp" from rtx * to rtx_insn_list **. (remove_from_dependence_list): Strenghten param "listp" from rtx * to rtx_insn_list **, and use methods when working with *listp. (remove_from_both_dependence_lists): Strengthen param "listp" from rtx * to rtx_insn_list ** (add_insn_mem_dependence): Strengthen local "insn_list" from rtx * to rtx_insn_list **. Eliminate local "link", in favor of two new locals "insn_node" and "mem_node", an rtx_insn_list * and an rtx respectively. (deps_analyze_insn): Split out uses 'f local "t" as an INSN_LIST by introducing local "cond_deps". (remove_from_deps): Strengthen param "insn" from rtx to rtx_insn *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_insns" and local "new_insns" from rtx to rtx_insn_list *. Strengthen param "old_insns_p" from rtx * to rtx_insn_list **. Use methods of rtx_insn_list. * store-motion.c (struct st_expr): Strengthen fields "antic_stores" and "avail_stores" from rtx to rtx_insn_list *. (st_expr_entry): Replace NULL_RTX with NULL when dealing with rtx_insn_list *. (find_moveable_store): Split out "tmp" into multiple more-tightly scoped locals. Use methods of rtx_insn_list *. (compute_store_table): Strengthen local "tmp" from rtx to rtx_insn *. Use methods of rtx_insn_list *. From-SVN: r214590
2014-08-27 21:53:39 +02:00
remove_list_node ((rtx *)listp);
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
free_INSN_LIST_node (node);
return elem;
}
/* Remove and free the first node in the EXPR_LIST pointed to by LISTP. */
rtx
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
remove_free_EXPR_LIST_node (rtx_expr_list **listp)
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
{
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
rtx_expr_list *node = *listp;
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
rtx elem = XEXP (node, 0);
Use rtx_expr_list in various places gcc/ 2014-08-27 David Malcolm <dmalcolm@redhat.com> * rtl.h (free_EXPR_LIST_list): Strengthen param from rtx * to rtx_expr_list **. (alloc_EXPR_LIST): Strengthen return type from rtx to rtx_expr_list *. (remove_free_EXPR_LIST_node): Likewise for param. * reload.h (struct reg_equivs_t): Strengthen field "alt_mem_list" from rtx to rtx_expr_list *. * sched-int.h (struct deps_desc): Strengthen fields "pending_read_mems" and "pending_write_mems" from rtx to rtx_expr_list *. * dwarf2out.c (decl_piece_varloc_ptr): Strengthen return type from rtx to rtx_expr_list *. * lists.c (alloc_INSN_LIST): Likewise, also for local "r". (free_EXPR_LIST_list): Strengthen param "listp" from rtx * to rtx_expr_list **. (remove_free_EXPR_LIST_node): Likewise. Strengthen local "node" from rtx to rtx_expr_list *. * loop-iv.c (simplify_using_initial_values): Strengthen local "cond_list" from rtx to rtx_expr_list *, and locals "pnode", "pnote_next" from rtx * to rtx_expr_list **. * sched-deps.c (remove_from_both_dependence_lists): Strengthen param "exprp" from rtx * to rtx_expr_list **. (add_insn_mem_dependence): Strengthen local "mem_list" from rtx * to rtx_expr_list **. Strengthen local "mem_node" from rtx to rtx_expr_list *. * sched-rgn.c (concat_insn_mem_list): Strengthen param "copy_mems" and local "new_mems" from rtx to rtx_expr_list *. Strengthen param "old_mems_p" from rtx * to rtx_expr_list **. * var-tracking.c (struct adjust_mem_data): Strengthen field "side_effects" from rtx to rtx_expr_list *. (adjust_insn): Replace NULL_RTX with NULL when assigning to rtx_expr_list *. (prepare_call_arguments): Likewise. From-SVN: r214605
2014-08-27 22:40:05 +02:00
remove_list_node ((rtx *)listp);
sel-sched.h, [...]: New files. 2008-08-31 Andrey Belevantsev <abel@ispras.ru> Dmitry Melnik <dm@ispras.ru> Dmitry Zhurikhin <zhur@ispras.ru> Alexander Monakov <amonakov@ispras.ru> Maxim Kuvyrkov <maxim@codesourcery.com> * sel-sched.h, sel-sched-dump.h, sel-sched-ir.h, sel-sched.c, sel-sched-dump.c, sel-sched-ir.c: New files. * Makefile.in (OBJS-common): Add selective scheduling object files. (sel-sched.o, sel-sched-dump.o, sel-sched-ir.o): New entries. (SEL_SCHED_IR_H, SEL_SCHED_DUMP_H): New entries. (sched-vis.o): Add dependency on $(INSN_ATTR_H). * cfghooks.h (get_cfg_hooks, set_cfg_hooks): New prototypes. * cfghooks.c (get_cfg_hooks, set_cfg_hooks): New functions. (make_forwarder_block): Update loop latch if we have redirected the loop latch edge. * cfgloop.c (get_loop_body_in_custom_order): New function. * cfgloop.h (LOOPS_HAVE_FALLTHRU_PREHEADERS): New enum field. (CP_FALLTHRU_PREHEADERS): Likewise. (get_loop_body_in_custom_order): Declare. * cfgloopmanip.c (has_preds_from_loop): New. (create_preheader): Honor CP_FALLTHRU_PREHEADERS. Assert that the preheader edge will be fall thru when it is set. * common.opt (fsel-sched-bookkeeping, fsel-sched-pipelining, fsel-sched-pipelining-outer-loops, fsel-sched-renaming, fsel-sched-substitution, fselective-scheduling): New flags. * cse.c (hash_rtx_cb): New. (hash_rtx): Use it. * dbgcnt.def (sel_sched_cnt, sel_sched_region_cnt, sel_sched_insn_cnt): New counters. * final.c (compute_alignments): Export. Free dominance info after loop_optimizer_finalize. * genattr.c (main): Output maximal_insn_latency prototype. * genautomata.c (output_default_latencies): New. Factor its code from ... (output_internal_insn_latency_func): ... here. (output_internal_maximal_insn_latency_func): New. (output_maximal_insn_latency_func): New. * hard-reg-set.h (UHOST_BITS_PER_WIDE_INT): Define unconditionally. (struct hard_reg_set_iterator): New. (hard_reg_set_iter_init, hard_reg_set_iter_set, hard_reg_set_iter_next): New functions. (EXECUTE_IF_SET_IN_HARD_REG_SET): New macro. * lists.c (remove_free_INSN_LIST_node, remove_free_EXPR_LIST_node): New functions. * loop-init.c (loop_optimizer_init): When LOOPS_HAVE_FALLTHRU_PREHEADERS, set CP_FALLTHRU_PREHEADERS when calling create_preheaders. (loop_optimizer_finalize): Do not verify flow info after reload. * recog.c (validate_replace_rtx_1): New parameter simplify. Default it to true. Update all uses. Factor out simplifying code to ... (simplify_while_replacing): ... this new function. (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): New. * recog.h (validate_replace_rtx_part, validate_replace_rtx_part_nosimplify): Declare. * rtl.c (rtx_equal_p_cb): New. (rtx_equal_p): Use it. * rtl.h (rtx_equal_p_cb, hash_rtx_cb): Declare. (remove_free_INSN_LIST_NODE, remove_free_EXPR_LIST_node, debug_bb_n_slim, debug_bb_slim, print_rtl_slim): Likewise. * vecprim.h: Add a vector type for unsigned int. * haifa-sched.c: Include vecprim.h and cfgloop.h. (issue_rate, sched_verbose_param, note_list, dfa_state_size, ready_try, cycle_issued_insns, spec_info): Make global. (readyp): Initialize. (dfa_lookahead): New global variable. (old_max_uid, old_last_basic_block): Remove. (h_i_d): Make it a vector. (INSN_TICK, INTER_TICK, QUEUE_INDEX, INSN_COST): Make them work through HID macro. (after_recovery, adding_bb_to_current_region_p): New variables to handle correct insertion of the recovery code. (struct ready_list): Move declaration to sched-int.h. (rgn_n_insns): Removed. (rtx_vec_t): Move to sched-int.h. (find_insn_reg_weight): Remove. (find_insn_reg_weight1): Rename to find_insn_reg_weight. (haifa_init_h_i_d, haifa_finish_h_i_d): New functions to initialize / finalize haifa instruction data. (extend_h_i_d, init_h_i_d): Rewrite. (unlink_other_notes): Move logic to add_to_note_list. Handle selective scheduler. (ready_lastpos, ready_element, ready_sort, reemit_notes, find_fallthru_edge): Make global, remove static prototypes. (max_issue): Make global. Add privileged_n and state parameters. Use them. (extend_global, extend_all): Removed. (init_before_recovery): Add new param. Fix the handling of the case when we insert a recovery code before the EXIT which has a predecessor with a fallthrough edge to it. (create_recovery_block): Make global. Rename to sched_create_recovery_block. Update. (change_pattern): Rename to sched_change_pattern. Make global. (speculate_insn): Rename to sched_speculate_insn. Make global. Split haifa-specific functionality into ... (haifa_change_pattern): New static function. (sched_extend_bb): New static function. (sched_init_bbs): New function. (current_sched_info): Change type to struct haifa_sched_info. (insn_cost): Adjust for selective scheduling. (dep_cost_1): New function. Move logic from ... (dep_cost): ... here. (dep_cost): Use dep_cost_1. (contributes_to_priority_p): Use sched_deps_info instead of current_sched_info. (priority): Adjust to work with selective scheduling. Process the corner case when all dependencies don't contribute to priority. (rank_for_schedule): Use ds_weak instead of dep_weak. (advance_state): New function. Move logic from ... (advance_one_cycle): ... here. (add_to_note_list, concat_note_lists): New functions. (rm_other_notes): Make static. Adjust for selective scheduling. (remove_notes, restore_other_notes): New functions. (move_insn): Add two arguments. Update assert. Don't call reemit_notes. (choose_ready): Remove lookahead variable, use dfa_lookahead. Remove more_issue, max_points. Move the code to initialize max_lookahead_tries to max_issue. (schedule_block): Remove rgn_n_insns1 parameter. Don't allocate ready. Adjust use of move_insn. Call restore_other_notes. (luid): Remove. (sched_init, sched_finish): Move Haifa-specific initialization/ finalization to ... (haifa_sched_init, haifa_sched_finish): ... respectively. New functions. (setup_sched_dump): New function. (haifa_init_only_bb): New static function. (haifa_speculate_insn): New static function. (try_ready): Use haifa_* instead of speculate_insn and change_pattern. (extend_ready, extend_all): Remove. (sched_extend_ready_list, sched_finish_ready_list): New functions. (create_check_block_twin, add_to_speculative_block): Use haifa_insns_init instead of extend_global. Update to use new initialization functions. Change parameter. Factor out code from create_check_block_twin to ... (sched_create_recovery_edges) ... this new function. (add_block): Remove. (sched_scan_info): New. (extend_bb): Use sched_scan_info. (init_bb, extend_insn, init_insn, init_insns_in_bb, sched_scan): New static functions for walking through scheduling region. (sched_luids): New vector variable to replace uid_to_luid. (luids_extend_insn): New function. (sched_max_luid): New variable. (luids_init_insn): New function. (sched_init_luids, sched_finish_luids): New functions. (insn_luid): New debug function. (sched_extend_target): New function. (haifa_init_insn): New static function. (sched_init_only_bb): New hook. (sched_split_block): New hook. (sched_split_block_1): New function. (sched_create_empty_bb): New hook. (sched_create_empty_bb_1): New function. (common_sched_info, ready): New global variables. (current_sched_info_var): Remove. (move_block_after_check): Use common_sched_info. (haifa_luid_for_non_insn): New static function. (init_before_recovery): Use haifa_init_only_bb instead of add_block. (increase_insn_priority): New. * modulo-sched.c: (issue_rate): Remove static declaration. (sms_sched_info): Change type to haifa_sched_info. (sms_sched_deps_info, sms_common_sched_info): New variables. (setup_sched_infos): New. (sms_schedule): Initialize them. Call haifa_sched_init/finish. Do not call regstat_free_calls_crossed. (sms_print_insn): Use const_rtx. * params.def (PARAM_MAX_PIPELINE_REGION_BLOCKS, PARAM_MAX_PIPELINE_REGION_INSNS, PARAM_SELSCHED_MAX_LOOKAHEAD, PARAM_SELSCHED_MAX_SCHED_TIMES, PARAM_SELSCHED_INSNS_TO_RENAME, PARAM_SCHED_MEM_TRUE_DEP_COST): New. * sched-deps.c (sched_deps_info): New. Update all relevant uses of current_sched_info to use it. (enum reg_pending_barrier_mode): Move to sched-int.h. (h_d_i_d): New variable. Initialize to NULL. ({true, output, anti, spec, forward}_dependency_cache): Initialize to NULL. (estimate_dep_weak): Remove static declaration. (sched_has_condition_p): New function. Adjust users of sched_get_condition to use it instead. (conditions_mutex_p): Add arguments indicating which conditions are reversed. Use them. (sched_get_condition_with_rev): Rename from sched_get_condition. Add argument to indicate whether returned condition is reversed. Do not generate new rtx when condition should be reversed; indicate it by setting new argument instead. (add_dependence_list_and_free): Add deps parameter. Update all users. Do not free dependence list when deps context is readonly. (add_insn_mem_dependence, flush_pending_lists): Adjust for readonly contexts. (remove_from_dependence_list, remove_from_both_dependence_lists): New. (remove_from_deps): New. Use the above functions. (cur_insn, can_start_lhs_rhs_p): New static variables. (add_or_update_back_dep_1): Initialize present_dep_type. (haifa_start_insn, haifa_finish_insn, haifa_note_reg_set, haifa_note_reg_clobber, haifa_note_reg_use, haifa_note_mem_dep, haifa_note_dep): New functions implementing dependence hooks for the Haifa scheduler. (note_reg_use, note_reg_set, note_reg_clobber, note_mem_dep, note_dep): New functions. (ds_to_dt, extend_deps_reg_info, maybe_extend_reg_info_p): New functions. (init_deps): Initialize last_reg_pending_barrier and deps->readonly. (free_deps): Initialize deps->reg_last. (sched_analyze_reg, sched_analyze_1, sched_analyze_2, sched_analyze_insn): Update to use dependency hooks infrastructure and readonly contexts. (deps_analyze_insn): New function. Move part of logic from ... (sched_analyze): ... here. Also move some logic to ... (deps_start_bb): ... here. New function. (add_forw_dep, delete_forw_dep): Guard use of INSN_DEP_COUNT with sel_sched_p. (sched_deps_init): New function. Move code from ... (init_dependency_caches): ... here. Remove. (init_deps_data_vector): New. (sched_deps_finish): New function. Move code from ... (free_dependency_caches): ... here. Remove. (init_deps_global, finish_deps_global): Adjust for use with selective scheduling. (get_dep_weak): Move logic to ... (get_dep_weak_1): New function. (ds_merge): Move logic to ... (ds_merge_1): New static function. (ds_full_merge, ds_max_merge, ds_get_speculation_types): New functions. (ds_get_max_dep_weak): New function. * sched-ebb.c (sched_n_insns): Rename to sched_rgn_n_insns. (n_insns): Rename to rgn_n_insns. (debug_ebb_dependencies): New function. (init_ready_list): Use it. (begin_schedule_ready): Use sched_init_only_bb. (ebb_print_insn): Indicate when an insn starts a new cycle. (contributes_to_priority, compute_jump_reg_dependencies, add_remove_insn, fix_recovery_cfg): Add ebb_ prefix to function names. (add_block1): Remove to ebb_add_block. (ebb_sched_deps_info, ebb_common_sched_info): New variables. (schedule_ebb): Initialize them. Use remove_notes instead of rm_other_notes. Use haifa_local_init/finish. (schedule_ebbs): Use haifa_sched_init/finish. * sched-int.h: Include vecprim.h, remove rtl.h. (struct ready_list): Delete declaration. (sched_verbose_param, enum sched_pass_id_t, bb_vec_t, insn_vec_t, rtx_vec_t): New. (struct sched_scan_info_def): New structure. (sched_scan_info, sched_scan, sched_init_bbs, sched_init_luids, sched_finish_luids, sched_extend_target, haifa_init_h_i_d, haifa_finish_h_i_d): Declare. (struct common_sched_info_def): New. (common_sched_info, haifa_common_sched_info, sched_emulate_haifa_p): Declare. (sel_sched_p): New. (sched_luids): Declare. (INSN_LUID, LUID_BY_UID, SET_INSN_LUID): Declare. (sched_max_luid, insn_luid): Declare. (note_list, remove_notes, restore_other_notes, bb_note): Declare. (sched_insns_init, sched_insns_finish, xrecalloc, reemit_notes, print_insn, print_pattern, print_value, haifa_classify_insn, sel_find_rgns, sel_mark_hard_insn, dfa_state_size, advance_state, setup_sched_dump, sched_init, sched_finish, sel_insn_is_speculation_check): Export. (struct ready_list): Move from haifa-sched.c. (ready_try, ready, max_issue): Export. (ebb_compute_jump_reg_dependencies, find_fallthru_edge, sched_init_only_bb, sched_split_block, sched_split_block_1, sched_create_empty_bb, sched_create_empty_bb_1, sched_create_recovery_block, sched_create_recovery_edges): Export. (enum reg_pending_barrier_mode): Export. (struct deps): New fields `last_reg_pending_barrier' and `readonly'. (deps_t): New. (struct sched_info): Rename to haifa_sched_info. Use const_rtx for print_insn field. Move add_block and fix_recovery_cfg to common_sched_info_def. Move compute_jump_reg_dependencies, use_cselib ... (struct sched_deps_info_def): ... this new structure. (sched_deps_info): Declare. (struct spec_info_def): Remove weakness_cutoff, add data_weakness_cutoff and control_weakness_cutoff. (spec_info): Declare. (struct _haifa_deps_insn_data): Split from haifa_insn_data. Add dep_count field. (struct haifa_insn_data): Rename to struct _haifa_insn_data. (haifa_insn_data_def, haifa_insn_data_t): New typedefs. (current_sched_info): Change type to struct haifa_sched_info. (haifa_deps_insn_data_def, haifa_deps_insn_data_t): New typedefs. (h_d_i_d): New variable. (HDID): New accessor macro. (h_i_d): Change type to VEC (haifa_insn_data_def, heap) *. (HID): New accessor macro. Rewrite h_i_d accessor macros through HID and HDID. (IS_SPECULATION_CHECK_P): Update for selective scheduler. (enum SCHED_FLAGS): Update for selective scheduler. (enum SPEC_SCHED_FLAGS): New flag SEL_SCHED_SPEC_DONT_CHECK_CONTROL. (init_dependency_caches, free_dependency_caches): Delete declarations. (deps_analyze_insn, remove_from_deps, get_dep_weak_1, estimate_dep_weak, ds_full_merge, ds_max_merge, ds_weak, ds_get_speculation_types, ds_get_max_dep_weak, sched_deps_init, sched_deps_finish, haifa_note_reg_set, haifa_note_reg_use, haifa_note_reg_clobber, maybe_extend_reg_info_p, deps_start_bb, ds_to_dt): Export. (rm_other_notes): Delete declaration. (schedule_block): Remove one argument. (cycle_issued_insns, issue_rate, dfa_lookahead, ready_sort, ready_element, ready_lastpos, sched_extend_ready_list, sched_finish_ready_list, sched_change_pattern, sched_speculate_insn, concat_note_lists): Export. (struct region): Move from sched-rgn.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN): Export. (ebb_head, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB, INSN_BB): Likewise. (current_nr_blocks, current_blocks, target_bb): Likewise. (dep_cost_1, sched_is_disabled_for_current_region_p, sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies, sched_rgn_local_init, extend_regions, rgn_make_new_region_out_of_new_block, compute_priorities, debug_rgn_dependencies, free_rgn_deps, contributes_to_priority, extend_rgns, deps_join rgn_setup_common_sched_info, rgn_setup_sched_infos, debug_regions, debug_region, dump_region_dot, dump_region_dot_file, haifa_sched_init, haifa_sched_finish): Export. (get_rgn_sched_max_insns_priority, sel_add_to_insn_priority, increase_insn_priority): Likewise. * sched-rgn.c: Include sel-sched.h. (ref_counts): New static variable. Use it ... (INSN_REF_COUNT): ... here. Rewrite and move closer to uses. (FED_BY_SPEC_LOAD, IS_LOAD_INSN): Rewrite to use HID accessor macro. (sched_is_disabled_for_current_region_p): Delete static declaration. (struct region): Move to sched-int.h. (nr_regions, rgn_table, rgn_bb_table, block_to_bb, containing_rgn, ebb_head): Define and initialize. (RGN_NR_BLOCKS, RGN_BLOCKS, RGN_DONT_CALC_DEPS, RGN_HAS_REAL_EBB, BLOCK_TO_BB, CONTAINING_RGN, debug_regions, extend_regions, BB_TO_BLOCK, EBB_FIRST_BB, EBB_LAST_BB): Move to sched-int.h. (find_single_block_region): Add new argument to indicate that EBB regions should be constructed. (debug_live): Delete declaration. (current_nr_blocks, current_blocks, target_bb): Remove static qualifiers. (compute_dom_prob_ps, check_live, update_live, set_spec_fed): Delete declaration. (init_regions): Delete declaration. (debug_region, bb_in_region_p, dump_region_dot_file, dump_region_dot, rgn_estimate_number_of_insns): New. (too_large): Use estimate_number_of_insns. (haifa_find_rgns): New. Move the code from ... (find_rgns): ... here. Call either sel_find_rgns or haifa_find_rgns. (free_trg_info): New. (compute_trg_info): Allocate candidate tables here instead of ... (init_ready_list): ... here. (rgn_print_insn): Use const_rtx. (contributes_to_priority, extend_regions): Delete static declaration. (add_remove_insn, fix_recovery_cfg): Add rgn_ to function names. (add_block1): Rename to rgn_add_block. (debug_rgn_dependencies): Delete static qualifier. (new_ready): Use sched_deps_info. Simplify. (rgn_common_sched_info, rgn_const_sched_deps_info, rgn_const_sel_sched_deps_info, rgn_sched_deps_info, rgn_sched_info): New. (region_sched_info): Rename to rgn_const_sched_info. (deps_join): New, extracted from ... (propagate_deps): ... here. (compute_block_dependences, debug_dependencies): Update for selective scheduling. (free_rgn_deps, compute_priorities): New functions. (sched_rgn_init, sched_rgn_finish, rgn_setup_region, sched_rgn_compute_dependencies): New functions. (schedule_region): Use them. (sched_rgn_local_init, sched_rgn_local_free, sched_rgn_local_finish, rgn_setup_common_sched_info, rgn_setup_sched_infos): New functions. (schedule_insns): Call new functions that were split out. (rgn_make_new_region_out_of_new_block): New. (get_rgn_sched_max_insns_priority): New. (rest_of_handle_sched, rest_of_handle_sched2): Call selective scheduling when appropriate. * sched-vis.c: Include insn-attr.h. (print_value, print_pattern): Make global. (print_rtl_slim, debug_bb_slim, debug_bb_n_slim): New functions. * target-def.h (TARGET_SCHED_ADJUST_COST_2, TARGET_SCHED_ALLOC_SCHED_CONTEXT, TARGET_SCHED_INIT_SCHED_CONTEXT, TARGET_SCHED_SET_SCHED_CONTEXT, TARGET_SCHED_CLEAR_SCHED_CONTEXT, TARGET_SCHED_FREE_SCHED_CONTEXT, TARGET_SCHED_GET_INSN_CHECKED_DS, TARGET_SCHED_GET_INSN_SPEC_DS, TARGET_SCHED_SKIP_RTX_P): New target hooks. Initialize them to 0. (TARGET_SCHED_GEN_CHECK): Rename to TARGET_SCHED_GEN_SPEC_CHECK. * target.h (struct gcc_target): Add them. Rename gen_check field to gen_spec_check. * flags.h (sel_sched_switch_set): Declare. * opts.c (sel_sched_switch_set): New variable. (decode_options): Unset flag_sel_sched_pipelining_outer_loops if pipelining is disabled from command line. (common_handle_option): Record whether selective scheduling is requested from command line. * doc/invoke.texi: Document new flags and parameters. * doc/tm.texi: Document new target hooks. * config/ia64/ia64.c (TARGET_SCHED_GEN_SPEC_CHECK): Define to ia64_gen_check. (dfa_state_size): Do not declare locally. * config/ia64/ia64.opt (msched-ar-data-spec): Default to 0. * config/rs6000/rs6000.c (rs6000_init_sched_context, rs6000_alloc_sched_context, rs6000_set_sched_context, rs6000_free_sched_context): New functions. (struct _rs6000_sched_context): New. (rs6000_sched_reorder2): Do not modify INSN_PRIORITY for selective scheduling. (rs6000_sched_finish): Do not run for selective scheduling. Co-Authored-By: Alexander Monakov <amonakov@ispras.ru> Co-Authored-By: Dmitry Melnik <dm@ispras.ru> Co-Authored-By: Dmitry Zhurikhin <zhur@ispras.ru> Co-Authored-By: Maxim Kuvyrkov <maxim@codesourcery.com> From-SVN: r139854
2008-09-01 10:57:00 +02:00
free_EXPR_LIST_node (node);
return elem;
}
#include "gt-lists.h"