1992-02-08 04:27:38 +01:00
|
|
|
|
/* Try to unroll loops, and split induction variables.
|
2002-01-10 21:12:57 +01:00
|
|
|
|
Copyright (C) 1992, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002
|
2000-09-12 16:43:25 +02:00
|
|
|
|
Free Software Foundation, Inc.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
Contributed by James E. Wilson, Cygnus Support/UC Berkeley.
|
|
|
|
|
|
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.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is free software; you can redistribute it and/or modify it under
|
|
|
|
|
the terms of the GNU General Public License as published by the Free
|
|
|
|
|
Software Foundation; either version 2, or (at your option) any later
|
|
|
|
|
version.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
GCC is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
|
|
|
for more details.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
Makefile.in, [...]: replace "GNU CC" with "GCC".
* Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c,
bitmap.h, builtin-types.def, builtins.c, builtins.def,
c-aux-info.c, c-common.c, c-common.def, c-common.h,
c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c,
c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in,
c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c,
caller-save.c, calls.c, collect2.c, collect2.h, combine.c,
conditions.h, config.gcc, configure.frag, configure.in,
conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c,
cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h,
dependence.c, df.c, df.h, diagnostic.c, diagnostic.h,
doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c,
dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c,
emit-rtl.c, errors.c, errors.h, except.c, except.h,
exgettext, explow.c, expmed.c, expr.c, expr.h, final.c,
fixproto, flags.h, flow.c, fold-const.c, fp-test.c,
function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp,
gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c,
gencheck.c, gencodes.c, genconfig.c, genemit.c,
genextract.c, genflags.c, gengenrtl.c, genmultilib,
genopinit.c, genoutput.c, genpeep.c, genrecog.c,
gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c,
ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c,
graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h,
gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h,
gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h,
hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h,
integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c,
libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h,
machmode.def, machmode.h, main.c, mbchar.c, mbchar.h,
mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk,
mkmap-symver.awk, optabs.c, output.h, params.c, params.def,
params.h, predict.c, predict.def, predict.h, prefix.c,
prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c,
read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c,
regclass.c, regmove.c, regrename.c, regs.h, reload.c,
reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c,
rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h,
sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c,
sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c,
ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c,
stringpool.c, system.h, timevar.c, timevar.def, timevar.h,
tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h,
tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h,
unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h,
unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c,
xcoffout.h: replace "GNU CC" with "GCC".
From-SVN: r45105
2001-08-22 16:35:51 +02:00
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
|
02111-1307, USA. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Try to unroll a loop, and split induction variables.
|
|
|
|
|
|
|
|
|
|
Loops for which the number of iterations can be calculated exactly are
|
|
|
|
|
handled specially. If the number of iterations times the insn_count is
|
|
|
|
|
less than MAX_UNROLLED_INSNS, then the loop is unrolled completely.
|
|
|
|
|
Otherwise, we try to unroll the loop a number of times modulo the number
|
|
|
|
|
of iterations, so that only one exit test will be needed. It is unrolled
|
|
|
|
|
a number of times approximately equal to MAX_UNROLLED_INSNS divided by
|
|
|
|
|
the insn count.
|
|
|
|
|
|
|
|
|
|
Otherwise, if the number of iterations can be calculated exactly at
|
|
|
|
|
run time, and the loop is always entered at the top, then we try to
|
|
|
|
|
precondition the loop. That is, at run time, calculate how many times
|
|
|
|
|
the loop will execute, and then execute the loop body a few times so
|
|
|
|
|
that the remaining iterations will be some multiple of 4 (or 2 if the
|
|
|
|
|
loop is large). Then fall through to a loop unrolled 4 (or 2) times,
|
|
|
|
|
with only one exit test needed at the end of the loop.
|
|
|
|
|
|
|
|
|
|
Otherwise, if the number of iterations can not be calculated exactly,
|
|
|
|
|
not even at run time, then we still unroll the loop a number of times
|
|
|
|
|
approximately equal to MAX_UNROLLED_INSNS divided by the insn count,
|
|
|
|
|
but there must be an exit test after each copy of the loop body.
|
|
|
|
|
|
|
|
|
|
For each induction variable, which is dead outside the loop (replaceable)
|
|
|
|
|
or for which we can easily calculate the final value, if we can easily
|
|
|
|
|
calculate its value at each place where it is set as a function of the
|
|
|
|
|
current loop unroll count and the variable's value at loop entry, then
|
|
|
|
|
the induction variable is split into `N' different variables, one for
|
|
|
|
|
each copy of the loop body. One variable is live across the backward
|
|
|
|
|
branch, and the others are all calculated as a function of this variable.
|
|
|
|
|
This helps eliminate data dependencies, and leads to further opportunities
|
|
|
|
|
for cse. */
|
|
|
|
|
|
|
|
|
|
/* Possible improvements follow: */
|
|
|
|
|
|
|
|
|
|
/* ??? Add an extra pass somewhere to determine whether unrolling will
|
|
|
|
|
give any benefit. E.g. after generating all unrolled insns, compute the
|
|
|
|
|
cost of all insns and compare against cost of insns in rolled loop.
|
|
|
|
|
|
|
|
|
|
- On traditional architectures, unrolling a non-constant bound loop
|
|
|
|
|
is a win if there is a giv whose only use is in memory addresses, the
|
1992-05-07 08:41:23 +02:00
|
|
|
|
memory addresses can be split, and hence giv increments can be
|
1992-02-08 04:27:38 +01:00
|
|
|
|
eliminated.
|
|
|
|
|
- It is also a win if the loop is executed many times, and preconditioning
|
|
|
|
|
can be performed for the loop.
|
|
|
|
|
Add code to check for these and similar cases. */
|
|
|
|
|
|
|
|
|
|
/* ??? Improve control of which loops get unrolled. Could use profiling
|
|
|
|
|
info to only unroll the most commonly executed loops. Perhaps have
|
2002-12-24 09:30:34 +01:00
|
|
|
|
a user specifiable option to control the amount of code expansion,
|
1992-02-08 04:27:38 +01:00
|
|
|
|
or the percent of loops to consider for unrolling. Etc. */
|
|
|
|
|
|
|
|
|
|
/* ??? Look at the register copies inside the loop to see if they form a
|
|
|
|
|
simple permutation. If so, iterate the permutation until it gets back to
|
|
|
|
|
the start state. This is how many times we should unroll the loop, for
|
|
|
|
|
best results, because then all register copies can be eliminated.
|
|
|
|
|
For example, the lisp nreverse function should be unrolled 3 times
|
|
|
|
|
while (this)
|
|
|
|
|
{
|
|
|
|
|
next = this->cdr;
|
|
|
|
|
this->cdr = prev;
|
|
|
|
|
prev = this;
|
|
|
|
|
this = next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
??? The number of times to unroll the loop may also be based on data
|
|
|
|
|
references in the loop. For example, if we have a loop that references
|
|
|
|
|
x[i-1], x[i], and x[i+1], we should unroll it a multiple of 3 times. */
|
|
|
|
|
|
|
|
|
|
/* ??? Add some simple linear equation solving capability so that we can
|
|
|
|
|
determine the number of loop iterations for more complex loops.
|
|
|
|
|
For example, consider this loop from gdb
|
|
|
|
|
#define SWAP_TARGET_AND_HOST(buffer,len)
|
|
|
|
|
{
|
|
|
|
|
char tmp;
|
|
|
|
|
char *p = (char *) buffer;
|
|
|
|
|
char *q = ((char *) buffer) + len - 1;
|
|
|
|
|
int iterations = (len + 1) >> 1;
|
|
|
|
|
int i;
|
|
|
|
|
for (p; p < q; p++, q--;)
|
1999-02-04 23:55:55 +01:00
|
|
|
|
{
|
|
|
|
|
tmp = *q;
|
|
|
|
|
*q = *p;
|
|
|
|
|
*p = tmp;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
Note that:
|
|
|
|
|
start value = p = &buffer + current_iteration
|
|
|
|
|
end value = q = &buffer + len - 1 - current_iteration
|
|
|
|
|
Given the loop exit test of "p < q", then there must be "q - p" iterations,
|
|
|
|
|
set equal to zero and solve for number of iterations:
|
|
|
|
|
q - p = len - 1 - 2*current_iteration = 0
|
|
|
|
|
current_iteration = (len - 1) / 2
|
|
|
|
|
Hence, there are (len - 1) / 2 (rounded up to the nearest integer)
|
|
|
|
|
iterations of this loop. */
|
|
|
|
|
|
|
|
|
|
/* ??? Currently, no labels are marked as loop invariant when doing loop
|
|
|
|
|
unrolling. This is because an insn inside the loop, that loads the address
|
|
|
|
|
of a label inside the loop into a register, could be moved outside the loop
|
|
|
|
|
by the invariant code motion pass if labels were invariant. If the loop
|
|
|
|
|
is subsequently unrolled, the code will be wrong because each unrolled
|
|
|
|
|
body of the loop will use the same address, whereas each actually needs a
|
|
|
|
|
different address. A case where this happens is when a loop containing
|
|
|
|
|
a switch statement is unrolled.
|
|
|
|
|
|
|
|
|
|
It would be better to let labels be considered invariant. When we
|
|
|
|
|
unroll loops here, check to see if any insns using a label local to the
|
|
|
|
|
loop were moved before the loop. If so, then correct the problem, by
|
|
|
|
|
moving the insn back into the loop, or perhaps replicate the insn before
|
|
|
|
|
the loop, one copy for each time the loop is unrolled. */
|
|
|
|
|
|
2001-12-30 16:58:42 +01:00
|
|
|
|
#include "config.h"
|
|
|
|
|
#include "system.h"
|
2002-12-16 19:23:00 +01:00
|
|
|
|
#include "coretypes.h"
|
|
|
|
|
#include "tm.h"
|
2001-12-30 16:58:42 +01:00
|
|
|
|
#include "rtl.h"
|
|
|
|
|
#include "tm_p.h"
|
|
|
|
|
#include "insn-config.h"
|
|
|
|
|
#include "integrate.h"
|
|
|
|
|
#include "regs.h"
|
|
|
|
|
#include "recog.h"
|
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "function.h"
|
|
|
|
|
#include "expr.h"
|
|
|
|
|
#include "loop.h"
|
|
|
|
|
#include "toplev.h"
|
|
|
|
|
#include "hard-reg-set.h"
|
|
|
|
|
#include "basic-block.h"
|
|
|
|
|
#include "predict.h"
|
2002-03-15 00:31:50 +01:00
|
|
|
|
#include "params.h"
|
cfgloopanal.c: New file.
* cfgloopanal.c: New file.
* cfgloopmanip.c: New file.
* Makefile.in (cfgloopanal.o, cfgloopmanip.o): New.
(toplev.o, loop.o, doloop.o, unroll.o, cfgloop.o, predict.o,
cfglayout.o): Add dependency on cfgloop.h.
(cfgloop.o): Add flags.h dependency.
* basic-block.h (BB_IRREDUCIBLE_LOOP, BB_SUPERBLOCK): New flags.
(VLS_EXPECT_PREHEADERS, VLS_EXPECT_SIMPLE_LATCHES): Removed.
(struct loop, struct loops, flow_loops_find, flow_loops_update,
flow_loops_free, flow_loops_dump, flow_loop_dump,
flow_loop_scan, flow_loop_tree_node_add, flow_loop_tree_node_remove,
LOOP_TREE,,LOOP_PRE_HEADER, LOOP_ENTRY_EDGES, LOOP_EXIT_EDGES,
LOOP_ALL, flow_loop_outside_edge_p, flow_loop_nested_p,
flow_bb_inside_loop_p, get_loop_body, loop_preheader_edge,
loop_latch_edge, add_bb_to_loop, remove_bb_from_loops,
find_common_loop, verify_loop_structure): Declarations moved to ...
* cfgloop.h: New file.
* bb-reorder.c (reorder_basic_blocks): Modified.
* cfglayout.c: Include cfgloop.h.
(cleanup_unconditional_jumps, cfg_layout_redirect_edge,
cfg_layout_duplicate_bb, cfg_layout_initialize): Update loop structure.
(break_superblocks): New static function.
(cfg_layout_finalize): Use it.
(cfg_layout_split_block): New function.
* cfglayout.h (struct reorder_block_def): Add copy and duplicated
fields.
(cfg_layout_initialize, cfg_layout_redirect_edge): Declaration
changed.
(cfg_layout_split_block): Declare.
* cfgloop.c: Include cfgloop.h and flags.h.
(flow_loop_dump, flow_loops_free, flow_loop_exit_edges_find,
get_loop_body): Avoid signed versus unsigned comparison warnings.
(make_forwarder_block, flow_loops_find, loop_preheader_edge,
loop_latch_edge): Modified.
(verify_loop_structure): Modified to use flags stored in loop structure;
check irreducible loops.
(cancel_loop, cancel_loop_tree): New functions.
(estimate_probability): Use loop analysis code for predictions.
(estimate_loops_at_level): Avoid signed versus unsigned comparison
warnings.
* doloop.c: Include cfgloop.h.
* loop.c: Include cfgloop.h.
* predict.c: Include cfgloop.h.
* toplev.c: Include cfgloop.h.
* unroll.c: Include cfgloop.h.
* tracer.c (tracer): Modified.
From-SVN: r61730
2003-01-24 21:27:02 +01:00
|
|
|
|
#include "cfgloop.h"
|
2001-12-30 16:58:42 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The prime factors looked for when trying to unroll a loop by some
|
|
|
|
|
number which is modulo the total number of iterations. Just checking
|
|
|
|
|
for these 4 prime factors will find at least one factor for 75% of
|
|
|
|
|
all numbers theoretically. Practically speaking, this will succeed
|
|
|
|
|
almost all of the time since loops are generally a multiple of 2
|
|
|
|
|
and/or 5. */
|
|
|
|
|
|
|
|
|
|
#define NUM_FACTORS 4
|
|
|
|
|
|
collect2.c (is_ctor_dtor): Const-ify.
* collect2.c (is_ctor_dtor): Const-ify.
* m88k-protos.c (output_file_start): Likewise.
* m88k.c (m88k_lang_independent_options, output_options,
output_file_start): Likewise.
* fix-header.c (files_to_ignore, std_include_entry, include_entry,
std_include_table, main): Likewise.
* protoize.c (longopts): Likewise.
* regclass.c (int_reg_class_contents): Likewise.
* toplev.c (dump_file, f_options, W_options): Make static.
(lang_independent_options, f_options, W_options): Const-ify.
* tree-dump.c (dump_file_info): Likewise.
* unroll.c (_factor): Make static.
java:
* chartables.h: Const-ify.
* gjavah.c (options): Likewise.
* jcf-dump.c (options): Likewise.
* jv-scan.c (options): Likewise.
* lex.c (java_start_char_p, java_part_char_p): Likewise.
* parse.y (binop_lookup): Likewise.
From-SVN: r48322
2001-12-27 04:35:21 +01:00
|
|
|
|
static struct _factor { const int factor; int count; }
|
2000-09-12 16:43:25 +02:00
|
|
|
|
factors[NUM_FACTORS] = { {2, 0}, {3, 0}, {5, 0}, {7, 0}};
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Describes the different types of loop unrolling performed. */
|
|
|
|
|
|
2000-09-12 16:43:25 +02:00
|
|
|
|
enum unroll_types
|
|
|
|
|
{
|
|
|
|
|
UNROLL_COMPLETELY,
|
|
|
|
|
UNROLL_MODULO,
|
|
|
|
|
UNROLL_NAIVE
|
|
|
|
|
};
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2002-09-27 14:48:07 +02:00
|
|
|
|
/* Indexed by register number, if nonzero, then it contains a pointer
|
1992-02-08 04:27:38 +01:00
|
|
|
|
to a struct induction for a DEST_REG giv which has been combined with
|
|
|
|
|
one of more address givs. This is needed because whenever such a DEST_REG
|
|
|
|
|
giv is modified, we must modify the value of all split address givs
|
|
|
|
|
that were combined with this DEST_REG giv. */
|
|
|
|
|
|
|
|
|
|
static struct induction **addr_combined_regs;
|
|
|
|
|
|
|
|
|
|
/* Indexed by register number, if this is a splittable induction variable,
|
|
|
|
|
then this will hold the current value of the register, which depends on the
|
|
|
|
|
iteration number. */
|
|
|
|
|
|
|
|
|
|
static rtx *splittable_regs;
|
|
|
|
|
|
|
|
|
|
/* Indexed by register number, if this is a splittable induction variable,
|
|
|
|
|
then this will hold the number of instructions in the loop that modify
|
|
|
|
|
the induction variable. Used to ensure that only the last insn modifying
|
|
|
|
|
a split iv will update the original iv of the dest. */
|
|
|
|
|
|
|
|
|
|
static int *splittable_regs_updates;
|
|
|
|
|
|
|
|
|
|
/* Forward declarations. */
|
|
|
|
|
|
2002-09-28 00:41:07 +02:00
|
|
|
|
static rtx simplify_cmp_and_jump_insns PARAMS ((enum rtx_code,
|
|
|
|
|
enum machine_mode,
|
|
|
|
|
rtx, rtx, rtx));
|
2000-01-17 16:55:18 +01:00
|
|
|
|
static void init_reg_map PARAMS ((struct inline_remap *, int));
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
static rtx calculate_giv_inc PARAMS ((rtx, rtx, unsigned int));
|
2000-01-17 16:55:18 +01:00
|
|
|
|
static rtx initial_reg_note_copy PARAMS ((rtx, struct inline_remap *));
|
2001-06-12 06:42:46 +02:00
|
|
|
|
static void final_reg_note_copy PARAMS ((rtx *, struct inline_remap *));
|
2000-09-11 23:48:46 +02:00
|
|
|
|
static void copy_loop_body PARAMS ((struct loop *, rtx, rtx,
|
|
|
|
|
struct inline_remap *, rtx, int,
|
|
|
|
|
enum unroll_types, rtx, rtx, rtx, rtx));
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
static int find_splittable_regs PARAMS ((const struct loop *,
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
enum unroll_types, int));
|
2000-09-12 16:43:25 +02:00
|
|
|
|
static int find_splittable_givs PARAMS ((const struct loop *,
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
struct iv_class *, enum unroll_types,
|
|
|
|
|
rtx, int));
|
|
|
|
|
static int reg_dead_after_loop PARAMS ((const struct loop *, rtx));
|
2000-01-17 16:55:18 +01:00
|
|
|
|
static rtx fold_rtx_mult_add PARAMS ((rtx, rtx, rtx, enum machine_mode));
|
2000-09-11 23:48:46 +02:00
|
|
|
|
static rtx remap_split_bivs PARAMS ((struct loop *, rtx));
|
2000-01-17 16:55:18 +01:00
|
|
|
|
static rtx find_common_reg_term PARAMS ((rtx, rtx));
|
|
|
|
|
static rtx subtract_reg_term PARAMS ((rtx, rtx));
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
static rtx loop_find_equiv_value PARAMS ((const struct loop *, rtx));
|
2000-09-07 15:10:51 +02:00
|
|
|
|
static rtx ujump_to_loop_cont PARAMS ((rtx, rtx));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Try to unroll one loop and split induction variables in the loop.
|
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
The loop is described by the arguments LOOP and INSN_COUNT.
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
STRENGTH_REDUCTION_P indicates whether information generated in the
|
|
|
|
|
strength reduction pass is available.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
This function is intended to be called from within `strength_reduce'
|
|
|
|
|
in loop.c. */
|
|
|
|
|
|
|
|
|
|
void
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
unroll_loop (loop, insn_count, strength_reduce_p)
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
int insn_count;
|
|
|
|
|
int strength_reduce_p;
|
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_info *loop_info = LOOP_INFO (loop);
|
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
1999-11-12 21:44:13 +01:00
|
|
|
|
int i, j;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int r;
|
1999-11-12 21:44:13 +01:00
|
|
|
|
unsigned HOST_WIDE_INT temp;
|
2000-02-19 02:27:00 +01:00
|
|
|
|
int unroll_number = 1;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx copy_start, copy_end;
|
1998-02-14 02:13:58 +01:00
|
|
|
|
rtx insn, sequence, pattern, tem;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
int max_labelno, max_insnno;
|
|
|
|
|
rtx insert_before;
|
|
|
|
|
struct inline_remap *map;
|
1999-08-25 15:37:46 +02:00
|
|
|
|
char *local_label = NULL;
|
1995-05-10 16:33:50 +02:00
|
|
|
|
char *local_regno;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int max_local_regnum;
|
|
|
|
|
unsigned int maxregnum;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx exit_label = 0;
|
|
|
|
|
rtx start_label;
|
|
|
|
|
struct iv_class *bl;
|
|
|
|
|
int splitting_not_safe = 0;
|
2000-02-02 00:51:38 +01:00
|
|
|
|
enum unroll_types unroll_type = UNROLL_NAIVE;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
int loop_preconditioned = 0;
|
|
|
|
|
rtx safety_label;
|
|
|
|
|
/* This points to the last real insn in the loop, which should be either
|
|
|
|
|
a JUMP_INSN (for conditional jumps) or a BARRIER (for unconditional
|
|
|
|
|
jumps). */
|
|
|
|
|
rtx last_loop_insn;
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
rtx loop_start = loop->start;
|
|
|
|
|
rtx loop_end = loop->end;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Don't bother unrolling huge loops. Since the minimum factor is
|
|
|
|
|
two, loops greater than one half of MAX_UNROLLED_INSNS will never
|
|
|
|
|
be unrolled. */
|
|
|
|
|
if (insn_count > MAX_UNROLLED_INSNS / 2)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream, "Unrolling failure: Loop too big.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Determine type of unroll to perform. Depends on the number of iterations
|
|
|
|
|
and the size of the loop. */
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
/* If there is no strength reduce info, then set
|
|
|
|
|
loop_info->n_iterations to zero. This can happen if
|
|
|
|
|
strength_reduce can't find any bivs in the loop. A value of zero
|
|
|
|
|
indicates that the number of iterations could not be calculated. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (! strength_reduce_p)
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->n_iterations = 0;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (loop_dump_stream && loop_info->n_iterations > 0)
|
1998-06-22 07:32:38 +02:00
|
|
|
|
{
|
|
|
|
|
fputs ("Loop unrolling: ", loop_dump_stream);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC,
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->n_iterations);
|
1998-06-22 07:32:38 +02:00
|
|
|
|
fputs (" iterations.\n", loop_dump_stream);
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Find and save a pointer to the last nonnote insn in the loop. */
|
|
|
|
|
|
|
|
|
|
last_loop_insn = prev_nonnote_insn (loop_end);
|
|
|
|
|
|
|
|
|
|
/* Calculate how many times to unroll the loop. Indicate whether or
|
|
|
|
|
not the loop is being completely unrolled. */
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (loop_info->n_iterations == 1)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
2000-09-07 15:10:51 +02:00
|
|
|
|
/* Handle the case where the loop begins with an unconditional
|
|
|
|
|
jump to the loop condition. Make sure to delete the jump
|
|
|
|
|
insn, otherwise the loop body will never execute. */
|
|
|
|
|
|
2003-03-25 21:24:42 +01:00
|
|
|
|
/* FIXME this actually checks for a jump to the continue point, which
|
|
|
|
|
is not the same as the condition in a for loop. As a result, this
|
|
|
|
|
optimization fails for most for loops. We should really use flow
|
|
|
|
|
information rather than instruction pattern matching. */
|
2000-09-07 15:10:51 +02:00
|
|
|
|
rtx ujump = ujump_to_loop_cont (loop->start, loop->cont);
|
2000-09-12 16:43:25 +02:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* If number of iterations is exactly 1, then eliminate the compare and
|
|
|
|
|
branch at the end of the loop since they will never be taken.
|
|
|
|
|
Then return, since no other action is needed here. */
|
|
|
|
|
|
|
|
|
|
/* If the last instruction is not a BARRIER or a JUMP_INSN, then
|
|
|
|
|
don't do anything. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
{
|
|
|
|
|
/* Delete the jump insn. This will delete the barrier also. */
|
2003-03-25 21:24:42 +01:00
|
|
|
|
last_loop_insn = PREV_INSN (last_loop_insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
2003-03-25 21:24:42 +01:00
|
|
|
|
|
|
|
|
|
if (ujump && GET_CODE (last_loop_insn) == JUMP_INSN)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1999-09-14 18:27:32 +02:00
|
|
|
|
#ifdef HAVE_cc0
|
1999-08-18 19:51:27 +02:00
|
|
|
|
rtx prev = PREV_INSN (last_loop_insn);
|
1999-09-14 18:27:32 +02:00
|
|
|
|
#endif
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (last_loop_insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
1999-08-18 19:51:27 +02:00
|
|
|
|
/* The immediately preceding insn may be a compare which must be
|
1992-02-08 04:27:38 +01:00
|
|
|
|
deleted. */
|
2001-08-15 21:25:43 +02:00
|
|
|
|
if (only_sets_cc0_p (prev))
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (prev);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#endif
|
1999-11-02 17:37:23 +01:00
|
|
|
|
|
2003-03-25 21:24:42 +01:00
|
|
|
|
delete_related_insns (ujump);
|
1999-11-02 17:37:23 +01:00
|
|
|
|
|
2003-03-25 21:24:42 +01:00
|
|
|
|
/* Remove the loop notes since this is no longer a loop. */
|
|
|
|
|
if (loop->vtop)
|
|
|
|
|
delete_related_insns (loop->vtop);
|
|
|
|
|
if (loop->cont)
|
|
|
|
|
delete_related_insns (loop->cont);
|
|
|
|
|
if (loop_start)
|
|
|
|
|
delete_related_insns (loop_start);
|
|
|
|
|
if (loop_end)
|
|
|
|
|
delete_related_insns (loop_end);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
2003-03-25 21:24:42 +01:00
|
|
|
|
|
|
|
|
|
if (loop_info->n_iterations > 0
|
|
|
|
|
/* Avoid overflow in the next expression. */
|
|
|
|
|
&& loop_info->n_iterations < (unsigned) MAX_UNROLLED_INSNS
|
|
|
|
|
&& loop_info->n_iterations * insn_count < (unsigned) MAX_UNROLLED_INSNS)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1998-11-25 22:19:21 +01:00
|
|
|
|
unroll_number = loop_info->n_iterations;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
unroll_type = UNROLL_COMPLETELY;
|
|
|
|
|
}
|
1998-11-25 22:19:21 +01:00
|
|
|
|
else if (loop_info->n_iterations > 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
/* Try to factor the number of iterations. Don't bother with the
|
|
|
|
|
general case, only using 2, 3, 5, and 7 will get 75% of all
|
|
|
|
|
numbers theoretically, and almost all in practice. */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < NUM_FACTORS; i++)
|
|
|
|
|
factors[i].count = 0;
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
temp = loop_info->n_iterations;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
for (i = NUM_FACTORS - 1; i >= 0; i--)
|
|
|
|
|
while (temp % factors[i].factor == 0)
|
|
|
|
|
{
|
|
|
|
|
factors[i].count++;
|
|
|
|
|
temp = temp / factors[i].factor;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Start with the larger factors first so that we generally
|
|
|
|
|
get lots of unrolling. */
|
|
|
|
|
|
|
|
|
|
unroll_number = 1;
|
|
|
|
|
temp = insn_count;
|
|
|
|
|
for (i = 3; i >= 0; i--)
|
|
|
|
|
while (factors[i].count--)
|
|
|
|
|
{
|
2002-08-02 02:50:01 +02:00
|
|
|
|
if (temp * factors[i].factor < (unsigned) MAX_UNROLLED_INSNS)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
unroll_number *= factors[i].factor;
|
|
|
|
|
temp *= factors[i].factor;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If we couldn't find any factors, then unroll as in the normal
|
|
|
|
|
case. */
|
|
|
|
|
if (unroll_number == 1)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
fprintf (loop_dump_stream, "Loop unrolling: No factors found.\n");
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
unroll_type = UNROLL_MODULO;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Default case, calculate number of times to unroll loop based on its
|
|
|
|
|
size. */
|
2000-02-02 00:51:38 +01:00
|
|
|
|
if (unroll_type == UNROLL_NAIVE)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (8 * insn_count < MAX_UNROLLED_INSNS)
|
|
|
|
|
unroll_number = 8;
|
|
|
|
|
else if (4 * insn_count < MAX_UNROLLED_INSNS)
|
|
|
|
|
unroll_number = 4;
|
|
|
|
|
else
|
|
|
|
|
unroll_number = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Now we know how many times to unroll the loop. */
|
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
fprintf (loop_dump_stream, "Unrolling loop %d times.\n", unroll_number);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY || unroll_type == UNROLL_MODULO)
|
|
|
|
|
{
|
1998-07-29 23:41:04 +02:00
|
|
|
|
/* Loops of these types can start with jump down to the exit condition
|
|
|
|
|
in rare circumstances.
|
|
|
|
|
|
|
|
|
|
Consider a pair of nested loops where the inner loop is part
|
|
|
|
|
of the exit code for the outer loop.
|
|
|
|
|
|
|
|
|
|
In this case jump.c will not duplicate the exit test for the outer
|
|
|
|
|
loop, so it will start with a jump to the exit code.
|
|
|
|
|
|
|
|
|
|
Then consider if the inner loop turns out to iterate once and
|
|
|
|
|
only once. We will end up deleting the jumps associated with
|
|
|
|
|
the inner loop. However, the loop notes are not removed from
|
|
|
|
|
the instruction stream.
|
|
|
|
|
|
|
|
|
|
And finally assume that we can compute the number of iterations
|
|
|
|
|
for the outer loop.
|
|
|
|
|
|
|
|
|
|
In this case unroll may want to unroll the outer loop even though
|
|
|
|
|
it starts with a jump to the outer loop's exit code.
|
|
|
|
|
|
|
|
|
|
We could try to optimize this case, but it hardly seems worth it.
|
|
|
|
|
Just return without unrolling the loop in such cases. */
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
insn = loop_start;
|
|
|
|
|
while (GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != JUMP_INSN)
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if (GET_CODE (insn) == JUMP_INSN)
|
1998-07-29 23:41:04 +02:00
|
|
|
|
return;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY)
|
|
|
|
|
{
|
|
|
|
|
/* Completely unrolling the loop: Delete the compare and branch at
|
|
|
|
|
the end (the last two instructions). This delete must done at the
|
|
|
|
|
very end of loop unrolling, to avoid problems with calls to
|
|
|
|
|
back_branch_in_range_p, which is called by find_splittable_regs.
|
|
|
|
|
All increments of splittable bivs/givs are changed to load constant
|
|
|
|
|
instructions. */
|
|
|
|
|
|
|
|
|
|
copy_start = loop_start;
|
|
|
|
|
|
|
|
|
|
/* Set insert_before to the instruction immediately after the JUMP_INSN
|
|
|
|
|
(or BARRIER), so that any NOTEs between the JUMP_INSN and the end of
|
|
|
|
|
the loop will be correctly handled by copy_loop_body. */
|
|
|
|
|
insert_before = NEXT_INSN (last_loop_insn);
|
|
|
|
|
|
|
|
|
|
/* Set copy_end to the insn before the jump at the end of the loop. */
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
copy_end = PREV_INSN (PREV_INSN (last_loop_insn));
|
|
|
|
|
else if (GET_CODE (last_loop_insn) == JUMP_INSN)
|
|
|
|
|
{
|
1999-08-18 19:51:27 +02:00
|
|
|
|
copy_end = PREV_INSN (last_loop_insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
1999-08-18 19:51:27 +02:00
|
|
|
|
/* The instruction immediately before the JUMP_INSN may be a compare
|
1992-02-08 04:27:38 +01:00
|
|
|
|
instruction which we do not want to copy. */
|
1999-08-18 19:51:27 +02:00
|
|
|
|
if (sets_cc0_p (PREV_INSN (copy_end)))
|
|
|
|
|
copy_end = PREV_INSN (copy_end);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* We currently can't unroll a loop if it doesn't end with a
|
|
|
|
|
JUMP_INSN. There would need to be a mechanism that recognizes
|
|
|
|
|
this case, and then inserts a jump after each loop body, which
|
|
|
|
|
jumps to after the last loop body. */
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: loop does not end with a JUMP_INSN.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (unroll_type == UNROLL_MODULO)
|
|
|
|
|
{
|
|
|
|
|
/* Partially unrolling the loop: The compare and branch at the end
|
|
|
|
|
(the last two instructions) must remain. Don't copy the compare
|
|
|
|
|
and branch instructions at the end of the loop. Insert the unrolled
|
|
|
|
|
code immediately before the compare/branch at the end so that the
|
|
|
|
|
code will fall through to them as before. */
|
|
|
|
|
|
|
|
|
|
copy_start = loop_start;
|
|
|
|
|
|
|
|
|
|
/* Set insert_before to the jump insn at the end of the loop.
|
|
|
|
|
Set copy_end to before the jump insn at the end of the loop. */
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
{
|
|
|
|
|
insert_before = PREV_INSN (last_loop_insn);
|
|
|
|
|
copy_end = PREV_INSN (insert_before);
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (last_loop_insn) == JUMP_INSN)
|
|
|
|
|
{
|
1999-08-18 19:51:27 +02:00
|
|
|
|
insert_before = last_loop_insn;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
1999-08-18 19:51:27 +02:00
|
|
|
|
/* The instruction immediately before the JUMP_INSN may be a compare
|
1992-02-08 04:27:38 +01:00
|
|
|
|
instruction which we do not want to copy or delete. */
|
1999-08-18 19:51:27 +02:00
|
|
|
|
if (sets_cc0_p (PREV_INSN (insert_before)))
|
|
|
|
|
insert_before = PREV_INSN (insert_before);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#endif
|
1999-08-18 19:51:27 +02:00
|
|
|
|
copy_end = PREV_INSN (insert_before);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* We currently can't unroll a loop if it doesn't end with a
|
|
|
|
|
JUMP_INSN. There would need to be a mechanism that recognizes
|
|
|
|
|
this case, and then inserts a jump after each loop body, which
|
|
|
|
|
jumps to after the last loop body. */
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: loop does not end with a JUMP_INSN.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Normal case: Must copy the compare and branch instructions at the
|
|
|
|
|
end of the loop. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
{
|
|
|
|
|
/* Loop ends with an unconditional jump and a barrier.
|
|
|
|
|
Handle this like above, don't copy jump and barrier.
|
|
|
|
|
This is not strictly necessary, but doing so prevents generating
|
|
|
|
|
unconditional jumps to an immediately following label.
|
|
|
|
|
|
|
|
|
|
This will be corrected below if the target of this jump is
|
|
|
|
|
not the start_label. */
|
|
|
|
|
|
|
|
|
|
insert_before = PREV_INSN (last_loop_insn);
|
|
|
|
|
copy_end = PREV_INSN (insert_before);
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (last_loop_insn) == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
/* Set insert_before to immediately after the JUMP_INSN, so that
|
|
|
|
|
NOTEs at the end of the loop will be correctly handled by
|
|
|
|
|
copy_loop_body. */
|
|
|
|
|
insert_before = NEXT_INSN (last_loop_insn);
|
|
|
|
|
copy_end = last_loop_insn;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* We currently can't unroll a loop if it doesn't end with a
|
|
|
|
|
JUMP_INSN. There would need to be a mechanism that recognizes
|
|
|
|
|
this case, and then inserts a jump after each loop body, which
|
|
|
|
|
jumps to after the last loop body. */
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: loop does not end with a JUMP_INSN.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If copying exit test branches because they can not be eliminated,
|
|
|
|
|
then must convert the fall through case of the branch to a jump past
|
|
|
|
|
the end of the loop. Create a label to emit after the loop and save
|
|
|
|
|
it for later use. Do not use the label after the loop, if any, since
|
|
|
|
|
it might be used by insns outside the loop, or there might be insns
|
|
|
|
|
added before it later by final_[bg]iv_value which must be after
|
|
|
|
|
the real exit label. */
|
|
|
|
|
exit_label = gen_label_rtx ();
|
|
|
|
|
|
|
|
|
|
insn = loop_start;
|
|
|
|
|
while (GET_CODE (insn) != CODE_LABEL && GET_CODE (insn) != JUMP_INSN)
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (insn) == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
/* The loop starts with a jump down to the exit condition test.
|
|
|
|
|
Start copying the loop after the barrier following this
|
|
|
|
|
jump insn. */
|
|
|
|
|
copy_start = NEXT_INSN (insn);
|
|
|
|
|
|
|
|
|
|
/* Splitting induction variables doesn't work when the loop is
|
|
|
|
|
entered via a jump to the bottom, because then we end up doing
|
|
|
|
|
a comparison against a new register for a split variable, but
|
|
|
|
|
we did not execute the set insn for the new register because
|
|
|
|
|
it was skipped over. */
|
|
|
|
|
splitting_not_safe = 1;
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Splitting not safe, because loop not entered at top.\n");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
copy_start = loop_start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This should always be the first label in the loop. */
|
|
|
|
|
start_label = NEXT_INSN (copy_start);
|
|
|
|
|
/* There may be a line number note and/or a loop continue note here. */
|
|
|
|
|
while (GET_CODE (start_label) == NOTE)
|
|
|
|
|
start_label = NEXT_INSN (start_label);
|
|
|
|
|
if (GET_CODE (start_label) != CODE_LABEL)
|
|
|
|
|
{
|
|
|
|
|
/* This can happen as a result of jump threading. If the first insns in
|
|
|
|
|
the loop test the same condition as the loop's backward jump, or the
|
|
|
|
|
opposite condition, then the backward jump will be modified to point
|
|
|
|
|
to elsewhere, and the loop's start label is deleted.
|
|
|
|
|
|
|
|
|
|
This case currently can not be handled by the loop unrolling code. */
|
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: unknown insns between BEG note and loop label.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
1993-11-06 22:50:29 +01:00
|
|
|
|
if (LABEL_NAME (start_label))
|
|
|
|
|
{
|
|
|
|
|
/* The jump optimization pass must have combined the original start label
|
|
|
|
|
with a named label for a goto. We can't unroll this case because
|
|
|
|
|
jumps which go to the named label must be handled differently than
|
|
|
|
|
jumps to the loop start, and it is impossible to differentiate them
|
|
|
|
|
in this case. */
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: loop start label is gone\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_NAIVE
|
|
|
|
|
&& GET_CODE (last_loop_insn) == BARRIER
|
1999-10-24 22:20:00 +02:00
|
|
|
|
&& GET_CODE (PREV_INSN (last_loop_insn)) == JUMP_INSN
|
1992-02-08 04:27:38 +01:00
|
|
|
|
&& start_label != JUMP_LABEL (PREV_INSN (last_loop_insn)))
|
|
|
|
|
{
|
|
|
|
|
/* In this case, we must copy the jump and barrier, because they will
|
|
|
|
|
not be converted to jumps to an immediately following label. */
|
|
|
|
|
|
|
|
|
|
insert_before = NEXT_INSN (last_loop_insn);
|
|
|
|
|
copy_end = last_loop_insn;
|
|
|
|
|
}
|
|
|
|
|
|
1997-02-20 22:43:33 +01:00
|
|
|
|
if (unroll_type == UNROLL_NAIVE
|
|
|
|
|
&& GET_CODE (last_loop_insn) == JUMP_INSN
|
|
|
|
|
&& start_label != JUMP_LABEL (last_loop_insn))
|
|
|
|
|
{
|
|
|
|
|
/* ??? The loop ends with a conditional branch that does not branch back
|
|
|
|
|
to the loop start label. In this case, we must emit an unconditional
|
|
|
|
|
branch to the loop exit after emitting the final branch.
|
|
|
|
|
copy_loop_body does not have support for this currently, so we
|
|
|
|
|
give up. It doesn't seem worthwhile to unroll anyways since
|
|
|
|
|
unrolling would increase the number of branch instructions
|
|
|
|
|
executed. */
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: final conditional branch not to loop start\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Allocate a translation table for the labels and insn numbers.
|
|
|
|
|
They will be filled in as we copy the insns in the loop. */
|
|
|
|
|
|
|
|
|
|
max_labelno = max_label_num ();
|
|
|
|
|
max_insnno = get_max_uid ();
|
|
|
|
|
|
1999-11-02 07:39:04 +01:00
|
|
|
|
/* Various paths through the unroll code may reach the "egress" label
|
|
|
|
|
without initializing fields within the map structure.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1999-11-02 07:39:04 +01:00
|
|
|
|
To be safe, we use xcalloc to zero the memory. */
|
|
|
|
|
map = (struct inline_remap *) xcalloc (1, sizeof (struct inline_remap));
|
1993-05-14 19:23:25 +02:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Allocate the label map. */
|
|
|
|
|
|
|
|
|
|
if (max_labelno > 0)
|
|
|
|
|
{
|
2002-03-25 03:49:09 +01:00
|
|
|
|
map->label_map = (rtx *) xcalloc (max_labelno, sizeof (rtx));
|
1999-11-02 00:19:44 +01:00
|
|
|
|
local_label = (char *) xcalloc (max_labelno, sizeof (char));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Search the loop and mark all local labels, i.e. the ones which have to
|
|
|
|
|
be distinct labels when copied. For all labels which might be
|
|
|
|
|
non-local, set their label_map entries to point to themselves.
|
|
|
|
|
If they happen to be local their label_map entries will be overwritten
|
|
|
|
|
before the loop body is copied. The label_map entries for local labels
|
|
|
|
|
will be set to a different value each time the loop body is copied. */
|
|
|
|
|
|
|
|
|
|
for (insn = copy_start; insn != loop_end; insn = NEXT_INSN (insn))
|
|
|
|
|
{
|
1998-06-22 14:02:52 +02:00
|
|
|
|
rtx note;
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (insn) == CODE_LABEL)
|
|
|
|
|
local_label[CODE_LABEL_NUMBER (insn)] = 1;
|
|
|
|
|
else if (GET_CODE (insn) == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
if (JUMP_LABEL (insn))
|
1997-12-18 23:42:41 +01:00
|
|
|
|
set_label_in_map (map,
|
|
|
|
|
CODE_LABEL_NUMBER (JUMP_LABEL (insn)),
|
|
|
|
|
JUMP_LABEL (insn));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else if (GET_CODE (PATTERN (insn)) == ADDR_VEC
|
|
|
|
|
|| GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC)
|
|
|
|
|
{
|
|
|
|
|
rtx pat = PATTERN (insn);
|
|
|
|
|
int diff_vec_p = GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC;
|
|
|
|
|
int len = XVECLEN (pat, diff_vec_p);
|
|
|
|
|
rtx label;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
{
|
|
|
|
|
label = XEXP (XVECEXP (pat, diff_vec_p, i), 0);
|
2000-09-12 16:43:25 +02:00
|
|
|
|
set_label_in_map (map, CODE_LABEL_NUMBER (label), label);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2001-01-07 03:26:51 +01:00
|
|
|
|
if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)))
|
1998-06-22 14:02:52 +02:00
|
|
|
|
set_label_in_map (map, CODE_LABEL_NUMBER (XEXP (note, 0)),
|
|
|
|
|
XEXP (note, 0));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Allocate space for the insn map. */
|
|
|
|
|
|
1999-11-02 00:19:44 +01:00
|
|
|
|
map->insn_map = (rtx *) xmalloc (max_insnno * sizeof (rtx));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Set this to zero, to indicate that we are doing loop unrolling,
|
|
|
|
|
not function inlining. */
|
|
|
|
|
map->inline_target = 0;
|
|
|
|
|
|
|
|
|
|
/* The register and constant maps depend on the number of registers
|
|
|
|
|
present, so the final maps can't be created until after
|
|
|
|
|
find_splittable_regs is called. However, they are needed for
|
|
|
|
|
preconditioning, so we create temporary maps when preconditioning
|
|
|
|
|
is performed. */
|
|
|
|
|
|
|
|
|
|
/* The preconditioning code may allocate two new pseudo registers. */
|
|
|
|
|
maxregnum = max_reg_num ();
|
|
|
|
|
|
1999-02-24 12:18:59 +01:00
|
|
|
|
/* local_regno is only valid for regnos < max_local_regnum. */
|
|
|
|
|
max_local_regnum = maxregnum;
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Allocate and zero out the splittable_regs and addr_combined_regs
|
|
|
|
|
arrays. These must be zeroed here because they will be used if
|
|
|
|
|
loop preconditioning is performed, and must be zero for that case.
|
|
|
|
|
|
|
|
|
|
It is safe to do this here, since the extra registers created by the
|
|
|
|
|
preconditioning code and find_splittable_regs will never be used
|
1992-05-07 08:41:23 +02:00
|
|
|
|
to access the splittable_regs[] and addr_combined_regs[] arrays. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1999-11-02 00:19:44 +01:00
|
|
|
|
splittable_regs = (rtx *) xcalloc (maxregnum, sizeof (rtx));
|
|
|
|
|
splittable_regs_updates = (int *) xcalloc (maxregnum, sizeof (int));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
addr_combined_regs
|
1999-11-02 00:19:44 +01:00
|
|
|
|
= (struct induction **) xcalloc (maxregnum, sizeof (struct induction *));
|
|
|
|
|
local_regno = (char *) xcalloc (maxregnum, sizeof (char));
|
1995-05-10 16:33:50 +02:00
|
|
|
|
|
|
|
|
|
/* Mark all local registers, i.e. the ones which are referenced only
|
1995-05-14 21:44:30 +02:00
|
|
|
|
inside the loop. */
|
|
|
|
|
if (INSN_UID (copy_end) < max_uid_for_loop)
|
1999-08-18 19:16:40 +02:00
|
|
|
|
{
|
|
|
|
|
int copy_start_luid = INSN_LUID (copy_start);
|
|
|
|
|
int copy_end_luid = INSN_LUID (copy_end);
|
1995-05-10 16:33:50 +02:00
|
|
|
|
|
1999-08-18 19:16:40 +02:00
|
|
|
|
/* If a register is used in the jump insn, we must not duplicate it
|
|
|
|
|
since it will also be used outside the loop. */
|
|
|
|
|
if (GET_CODE (copy_end) == JUMP_INSN)
|
|
|
|
|
copy_end_luid--;
|
1999-04-08 01:07:06 +02:00
|
|
|
|
|
1999-08-18 19:16:40 +02:00
|
|
|
|
/* If we have a target that uses cc0, then we also must not duplicate
|
1999-08-18 19:51:27 +02:00
|
|
|
|
the insn that sets cc0 before the jump insn, if one is present. */
|
1999-04-08 01:07:06 +02:00
|
|
|
|
#ifdef HAVE_cc0
|
2000-09-12 16:43:25 +02:00
|
|
|
|
if (GET_CODE (copy_end) == JUMP_INSN
|
|
|
|
|
&& sets_cc0_p (PREV_INSN (copy_end)))
|
1999-08-18 19:16:40 +02:00
|
|
|
|
copy_end_luid--;
|
1999-04-08 01:07:06 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
1999-08-18 19:16:40 +02:00
|
|
|
|
/* If copy_start points to the NOTE that starts the loop, then we must
|
|
|
|
|
use the next luid, because invariant pseudo-regs moved out of the loop
|
|
|
|
|
have their lifetimes modified to start here, but they are not safe
|
|
|
|
|
to duplicate. */
|
|
|
|
|
if (copy_start == loop_start)
|
|
|
|
|
copy_start_luid++;
|
|
|
|
|
|
|
|
|
|
/* If a pseudo's lifetime is entirely contained within this loop, then we
|
|
|
|
|
can use a different pseudo in each unrolled copy of the loop. This
|
|
|
|
|
results in better code. */
|
|
|
|
|
/* We must limit the generic test to max_reg_before_loop, because only
|
|
|
|
|
these pseudo registers have valid regno_first_uid info. */
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
for (r = FIRST_PSEUDO_REGISTER; r < max_reg_before_loop; ++r)
|
|
|
|
|
if (REGNO_FIRST_UID (r) > 0 && REGNO_FIRST_UID (r) <= max_uid_for_loop
|
2001-01-01 01:14:30 +01:00
|
|
|
|
&& REGNO_FIRST_LUID (r) >= copy_start_luid
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
&& REGNO_LAST_UID (r) > 0 && REGNO_LAST_UID (r) <= max_uid_for_loop
|
2001-01-01 01:14:30 +01:00
|
|
|
|
&& REGNO_LAST_LUID (r) <= copy_end_luid)
|
1999-08-18 19:16:40 +02:00
|
|
|
|
{
|
|
|
|
|
/* However, we must also check for loop-carried dependencies.
|
|
|
|
|
If the value the pseudo has at the end of iteration X is
|
|
|
|
|
used by iteration X+1, then we can not use a different pseudo
|
|
|
|
|
for each unrolled copy of the loop. */
|
|
|
|
|
/* A pseudo is safe if regno_first_uid is a set, and this
|
|
|
|
|
set dominates all instructions from regno_first_uid to
|
|
|
|
|
regno_last_uid. */
|
|
|
|
|
/* ??? This check is simplistic. We would get better code if
|
|
|
|
|
this check was more sophisticated. */
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
if (set_dominates_use (r, REGNO_FIRST_UID (r), REGNO_LAST_UID (r),
|
1999-08-18 19:16:40 +02:00
|
|
|
|
copy_start, copy_end))
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
local_regno[r] = 1;
|
1999-08-18 19:16:40 +02:00
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
if (local_regno[r])
|
|
|
|
|
fprintf (loop_dump_stream, "Marked reg %d as local\n", r);
|
1999-08-18 19:16:40 +02:00
|
|
|
|
else
|
|
|
|
|
fprintf (loop_dump_stream, "Did not mark reg %d as local\n",
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
r);
|
1999-08-18 19:16:40 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* If this loop requires exit tests when unrolled, check to see if we
|
|
|
|
|
can precondition the loop so as to make the exit tests unnecessary.
|
|
|
|
|
Just like variable splitting, this is not safe if the loop is entered
|
|
|
|
|
via a jump to the bottom. Also, can not do this if no strength
|
|
|
|
|
reduce info, because precondition_loop_p uses this info. */
|
|
|
|
|
|
|
|
|
|
/* Must copy the loop body for preconditioning before the following
|
|
|
|
|
find_splittable_regs call since that will emit insns which need to
|
|
|
|
|
be after the preconditioned loop copies, but immediately before the
|
|
|
|
|
unrolled loop copies. */
|
|
|
|
|
|
|
|
|
|
/* Also, it is not safe to split induction variables for the preconditioned
|
|
|
|
|
copies of the loop body. If we split induction variables, then the code
|
|
|
|
|
assumes that each induction variable can be represented as a function
|
|
|
|
|
of its initial value and the loop iteration number. This is not true
|
|
|
|
|
in this case, because the last preconditioned copy of the loop body
|
|
|
|
|
could be any iteration from the first up to the `unroll_number-1'th,
|
|
|
|
|
depending on the initial value of the iteration variable. Therefore
|
|
|
|
|
we can not split induction variables here, because we can not calculate
|
|
|
|
|
their value. Hence, this code must occur before find_splittable_regs
|
|
|
|
|
is called. */
|
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_NAIVE && ! splitting_not_safe && strength_reduce_p)
|
|
|
|
|
{
|
|
|
|
|
rtx initial_value, final_value, increment;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
enum machine_mode mode;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (precondition_loop_p (loop,
|
1998-11-25 22:32:27 +01:00
|
|
|
|
&initial_value, &final_value, &increment,
|
|
|
|
|
&mode))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
2002-09-28 00:41:07 +02:00
|
|
|
|
rtx diff, insn;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx *labels;
|
|
|
|
|
int abs_inc, neg_inc;
|
2001-12-01 00:27:52 +01:00
|
|
|
|
enum rtx_code cc = loop_info->comparison_code;
|
|
|
|
|
int less_p = (cc == LE || cc == LEU || cc == LT || cc == LTU);
|
|
|
|
|
int unsigned_p = (cc == LEU || cc == GEU || cc == LTU || cc == GTU);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1999-11-02 00:19:44 +01:00
|
|
|
|
map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray, maxregnum,
|
2000-04-27 14:57:35 +02:00
|
|
|
|
"unroll_loop_precondition");
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
global_const_equiv_varray = map->const_equiv_varray;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
init_reg_map (map, maxregnum);
|
|
|
|
|
|
|
|
|
|
/* Limit loop unrolling to 4, since this will make 7 copies of
|
|
|
|
|
the loop body. */
|
|
|
|
|
if (unroll_number > 4)
|
|
|
|
|
unroll_number = 4;
|
|
|
|
|
|
|
|
|
|
/* Save the absolute value of the increment, and also whether or
|
|
|
|
|
not it is negative. */
|
|
|
|
|
neg_inc = 0;
|
|
|
|
|
abs_inc = INTVAL (increment);
|
|
|
|
|
if (abs_inc < 0)
|
|
|
|
|
{
|
2000-09-12 16:43:25 +02:00
|
|
|
|
abs_inc = -abs_inc;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
neg_inc = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
2002-09-28 00:41:07 +02:00
|
|
|
|
/* We must copy the final and initial values here to avoid
|
|
|
|
|
improperly shared rtl. */
|
|
|
|
|
final_value = copy_rtx (final_value);
|
|
|
|
|
initial_value = copy_rtx (initial_value);
|
|
|
|
|
|
2002-01-25 22:46:07 +01:00
|
|
|
|
/* Final value may have form of (PLUS val1 const1_rtx). We need
|
|
|
|
|
to convert it into general operand, so compute the real value. */
|
|
|
|
|
|
2002-09-28 00:41:07 +02:00
|
|
|
|
final_value = force_operand (final_value, NULL_RTX);
|
2002-01-25 22:46:07 +01:00
|
|
|
|
if (!nonmemory_operand (final_value, VOIDmode))
|
2002-09-28 00:41:07 +02:00
|
|
|
|
final_value = force_reg (mode, final_value);
|
2002-01-25 22:46:07 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Calculate the difference between the final and initial values.
|
|
|
|
|
Final value may be a (plus (reg x) (const_int 1)) rtx.
|
2001-12-01 00:27:52 +01:00
|
|
|
|
|
|
|
|
|
We have to deal with for (i = 0; --i < 6;) type loops.
|
|
|
|
|
For such loops the real final value is the first time the
|
|
|
|
|
loop variable overflows, so the diff we calculate is the
|
|
|
|
|
distance from the overflow value. This is 0 or ~0 for
|
|
|
|
|
unsigned loops depending on the direction, or INT_MAX,
|
|
|
|
|
INT_MAX+1 for signed loops. We really do not need the
|
|
|
|
|
exact value, since we are only interested in the diff
|
|
|
|
|
modulo the increment, and the increment is a power of 2,
|
|
|
|
|
so we can pretend that the overflow value is 0/~0. */
|
|
|
|
|
|
|
|
|
|
if (cc == NE || less_p != neg_inc)
|
2002-09-28 00:41:07 +02:00
|
|
|
|
diff = simplify_gen_binary (MINUS, mode, final_value,
|
|
|
|
|
initial_value);
|
2001-12-01 00:27:52 +01:00
|
|
|
|
else
|
2002-09-28 00:41:07 +02:00
|
|
|
|
diff = simplify_gen_unary (neg_inc ? NOT : NEG, mode,
|
|
|
|
|
initial_value, mode);
|
|
|
|
|
diff = force_operand (diff, NULL_RTX);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Now calculate (diff % (unroll * abs (increment))) by using an
|
|
|
|
|
and instruction. */
|
2002-09-28 00:41:07 +02:00
|
|
|
|
diff = simplify_gen_binary (AND, mode, diff,
|
|
|
|
|
GEN_INT (unroll_number*abs_inc - 1));
|
|
|
|
|
diff = force_operand (diff, NULL_RTX);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Now emit a sequence of branches to jump to the proper precond
|
|
|
|
|
loop entry point. */
|
|
|
|
|
|
1999-11-02 00:19:44 +01:00
|
|
|
|
labels = (rtx *) xmalloc (sizeof (rtx) * unroll_number);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
for (i = 0; i < unroll_number; i++)
|
|
|
|
|
labels[i] = gen_label_rtx ();
|
|
|
|
|
|
1996-10-22 00:43:33 +02:00
|
|
|
|
/* Check for the case where the initial value is greater than or
|
|
|
|
|
equal to the final value. In that case, we want to execute
|
|
|
|
|
exactly one loop iteration. The code below will fail for this
|
|
|
|
|
case. This check does not apply if the loop has a NE
|
|
|
|
|
comparison at the end. */
|
1995-07-28 15:57:46 +02:00
|
|
|
|
|
2001-12-01 00:27:52 +01:00
|
|
|
|
if (cc != NE)
|
1996-10-22 00:43:33 +02:00
|
|
|
|
{
|
2001-12-01 00:27:52 +01:00
|
|
|
|
rtx incremented_initval;
|
2002-09-28 00:41:07 +02:00
|
|
|
|
enum rtx_code cmp_code;
|
|
|
|
|
|
|
|
|
|
incremented_initval
|
|
|
|
|
= simplify_gen_binary (PLUS, mode, initial_value, increment);
|
|
|
|
|
incremented_initval
|
|
|
|
|
= force_operand (incremented_initval, NULL_RTX);
|
|
|
|
|
|
|
|
|
|
cmp_code = (less_p
|
|
|
|
|
? (unsigned_p ? GEU : GE)
|
|
|
|
|
: (unsigned_p ? LEU : LE));
|
|
|
|
|
|
|
|
|
|
insn = simplify_cmp_and_jump_insns (cmp_code, mode,
|
|
|
|
|
incremented_initval,
|
|
|
|
|
final_value, labels[1]);
|
|
|
|
|
if (insn)
|
|
|
|
|
predict_insn_def (insn, PRED_LOOP_CONDITION, TAKEN);
|
1996-10-22 00:43:33 +02:00
|
|
|
|
}
|
1995-07-28 15:57:46 +02:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Assuming the unroll_number is 4, and the increment is 2, then
|
|
|
|
|
for a negative increment: for a positive increment:
|
|
|
|
|
diff = 0,1 precond 0 diff = 0,7 precond 0
|
|
|
|
|
diff = 2,3 precond 3 diff = 1,2 precond 1
|
|
|
|
|
diff = 4,5 precond 2 diff = 3,4 precond 2
|
|
|
|
|
diff = 6,7 precond 1 diff = 5,6 precond 3 */
|
|
|
|
|
|
|
|
|
|
/* We only need to emit (unroll_number - 1) branches here, the
|
|
|
|
|
last case just falls through to the following code. */
|
|
|
|
|
|
|
|
|
|
/* ??? This would give better code if we emitted a tree of branches
|
|
|
|
|
instead of the current linear list of branches. */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < unroll_number - 1; i++)
|
|
|
|
|
{
|
|
|
|
|
int cmp_const;
|
1995-07-28 15:57:46 +02:00
|
|
|
|
enum rtx_code cmp_code;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* For negative increments, must invert the constant compared
|
|
|
|
|
against, except when comparing against zero. */
|
|
|
|
|
if (i == 0)
|
1995-07-28 15:57:46 +02:00
|
|
|
|
{
|
|
|
|
|
cmp_const = 0;
|
|
|
|
|
cmp_code = EQ;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else if (neg_inc)
|
1995-07-28 15:57:46 +02:00
|
|
|
|
{
|
|
|
|
|
cmp_const = unroll_number - i;
|
|
|
|
|
cmp_code = GE;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
1995-07-28 15:57:46 +02:00
|
|
|
|
{
|
|
|
|
|
cmp_const = i;
|
|
|
|
|
cmp_code = LE;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2002-09-28 00:41:07 +02:00
|
|
|
|
insn = simplify_cmp_and_jump_insns (cmp_code, mode, diff,
|
|
|
|
|
GEN_INT (abs_inc*cmp_const),
|
|
|
|
|
labels[i]);
|
|
|
|
|
if (insn)
|
|
|
|
|
predict_insn (insn, PRED_LOOP_PRECONDITIONING,
|
|
|
|
|
REG_BR_PROB_BASE / (unroll_number - i));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If the increment is greater than one, then we need another branch,
|
|
|
|
|
to handle other cases equivalent to 0. */
|
|
|
|
|
|
|
|
|
|
/* ??? This should be merged into the code above somehow to help
|
|
|
|
|
simplify the code here, and reduce the number of branches emitted.
|
|
|
|
|
For the negative increment case, the branch here could easily
|
|
|
|
|
be merged with the `0' case branch above. For the positive
|
|
|
|
|
increment case, it is not clear how this can be simplified. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (abs_inc != 1)
|
|
|
|
|
{
|
|
|
|
|
int cmp_const;
|
1995-07-28 15:57:46 +02:00
|
|
|
|
enum rtx_code cmp_code;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (neg_inc)
|
1995-07-28 15:57:46 +02:00
|
|
|
|
{
|
|
|
|
|
cmp_const = abs_inc - 1;
|
|
|
|
|
cmp_code = LE;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
1995-07-28 15:57:46 +02:00
|
|
|
|
{
|
|
|
|
|
cmp_const = abs_inc * (unroll_number - 1) + 1;
|
|
|
|
|
cmp_code = GE;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2002-09-28 00:41:07 +02:00
|
|
|
|
simplify_cmp_and_jump_insns (cmp_code, mode, diff,
|
|
|
|
|
GEN_INT (cmp_const), labels[0]);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
sequence = get_insns ();
|
1992-02-08 04:27:38 +01:00
|
|
|
|
end_sequence ();
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_insn_hoist (loop, sequence);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Only the last copy of the loop body here needs the exit
|
|
|
|
|
test, so set copy_end to exclude the compare/branch here,
|
|
|
|
|
and then reset it inside the loop when get to the last
|
|
|
|
|
copy. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
copy_end = PREV_INSN (PREV_INSN (last_loop_insn));
|
|
|
|
|
else if (GET_CODE (last_loop_insn) == JUMP_INSN)
|
|
|
|
|
{
|
1999-08-18 19:51:27 +02:00
|
|
|
|
copy_end = PREV_INSN (last_loop_insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
2000-09-12 16:43:25 +02:00
|
|
|
|
/* The immediately preceding insn may be a compare which
|
|
|
|
|
we do not want to copy. */
|
1999-08-18 19:51:27 +02:00
|
|
|
|
if (sets_cc0_p (PREV_INSN (copy_end)))
|
|
|
|
|
copy_end = PREV_INSN (copy_end);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
for (i = 1; i < unroll_number; i++)
|
|
|
|
|
{
|
|
|
|
|
emit_label_after (labels[unroll_number - i],
|
|
|
|
|
PREV_INSN (loop_start));
|
|
|
|
|
|
alias.c [...] (init_alias_analysis, [...]): Use memset () instead of bzero ().
* alias.c (init_alias_analysis), calls.c (expand_call,
emit_library_call_value_1), combine.c (init_reg_last_arrays),
cse.c (new_basic_block), dbxout.c (dbxout_type), diagnostic.c
(init_output_buffer, set_diagnostic_context), dwarf2out.c
(equate_decl_number_to_die, build_abbrev_table), emit-rtl.c
(init_emit_once), fold-const.c (mul_double, div_and_round_double),
function.c (assign_parms), gcse.c (compute_can_copy,
alloc_gcse_mem, alloc_reg_set_mem, record_one_set,
compute_hash_table, compute_set_hash_table,
compute_expr_hash_table), genattrtab.c (optimize_attrs), global.c
(global_alloc, global_conflicts), haifa-sched.c (compute_trg_info,
clear_units, schedule_block), integrate.c (initialize_for_inline,
expand_inline_function), jump.c (thread_jumps), local-alloc.c
(local_alloc), loop.c (combine_movables, count_loop_regs_set,
load_mems_and_recount_loop_regs_set), print-tree.c (debug_tree),
regclass.c (init_reg_sets, init_reg_sets_1, regclass,
record_reg_classes, allocate_reg_info), reload.c
(get_secondary_mem, remove_address_replacements, find_reloads),
reload1.c (reload, set_initial_label_offsets, finish_spills,
reload_as_needed, choose_reload_regs_init,
reload_cse_simplify_operands), reorg.c (dbr_schedule), sbitmap.c
(sbitmap_zero), simplify-rtx.c (simplify_plus_minus), ssa.c
(rename_registers), stmt.c (expand_end_case), unroll.c
(unroll_loop), varray.c (varray_grow), objc/objc-act.c: Use memset
() instead of bzero ().
ch:
* actions.c (check_missing_cases), typeck.c (build_chill_slice,
build_chill_cast): Use memset () instead of bzero ().
cp:
* class.c (duplicate_tag_error, build_vtbl_initializer), decl.c
(push_binding_level), error.c (cp_tree_printer), pt.c
(process_partial_specialization, tsubst_template_arg_vector),
search.c (lookup_member): Use memset () instead of bzero ().
java:
* expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
(init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
instead of bzero ().
From-SVN: r37303
2000-11-07 23:50:06 +01:00
|
|
|
|
memset ((char *) map->insn_map, 0, max_insnno * sizeof (rtx));
|
|
|
|
|
memset ((char *) &VARRAY_CONST_EQUIV (map->const_equiv_varray, 0),
|
|
|
|
|
0, (VARRAY_SIZE (map->const_equiv_varray)
|
|
|
|
|
* sizeof (struct const_equiv_data)));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
map->const_age = 0;
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < max_labelno; j++)
|
|
|
|
|
if (local_label[j])
|
1997-12-18 23:42:41 +01:00
|
|
|
|
set_label_in_map (map, j, gen_label_rtx ());
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
for (r = FIRST_PSEUDO_REGISTER; r < max_local_regnum; r++)
|
|
|
|
|
if (local_regno[r])
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
map->reg_map[r]
|
|
|
|
|
= gen_reg_rtx (GET_MODE (regno_reg_rtx[r]));
|
|
|
|
|
record_base_value (REGNO (map->reg_map[r]),
|
|
|
|
|
regno_reg_rtx[r], 0);
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The last copy needs the compare/branch insns at the end,
|
|
|
|
|
so reset copy_end here if the loop ends with a conditional
|
|
|
|
|
branch. */
|
|
|
|
|
|
|
|
|
|
if (i == unroll_number - 1)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
copy_end = PREV_INSN (PREV_INSN (last_loop_insn));
|
|
|
|
|
else
|
|
|
|
|
copy_end = last_loop_insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* None of the copies are the `last_iteration', so just
|
|
|
|
|
pass zero for that parameter. */
|
2000-09-11 23:48:46 +02:00
|
|
|
|
copy_loop_body (loop, copy_start, copy_end, map, exit_label, 0,
|
1992-02-08 04:27:38 +01:00
|
|
|
|
unroll_type, start_label, loop_end,
|
|
|
|
|
loop_start, copy_end);
|
|
|
|
|
}
|
|
|
|
|
emit_label_after (labels[0], PREV_INSN (loop_start));
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (last_loop_insn) == BARRIER)
|
|
|
|
|
{
|
|
|
|
|
insert_before = PREV_INSN (last_loop_insn);
|
|
|
|
|
copy_end = PREV_INSN (insert_before);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
insert_before = last_loop_insn;
|
1999-08-18 19:51:27 +02:00
|
|
|
|
#ifdef HAVE_cc0
|
2000-09-12 16:43:25 +02:00
|
|
|
|
/* The instruction immediately before the JUMP_INSN may
|
|
|
|
|
be a compare instruction which we do not want to copy
|
|
|
|
|
or delete. */
|
1999-08-18 19:51:27 +02:00
|
|
|
|
if (sets_cc0_p (PREV_INSN (insert_before)))
|
|
|
|
|
insert_before = PREV_INSN (insert_before);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#endif
|
1999-08-18 19:51:27 +02:00
|
|
|
|
copy_end = PREV_INSN (insert_before);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set unroll type to MODULO now. */
|
|
|
|
|
unroll_type = UNROLL_MODULO;
|
|
|
|
|
loop_preconditioned = 1;
|
1999-11-02 00:19:44 +01:00
|
|
|
|
|
|
|
|
|
/* Clean up. */
|
|
|
|
|
free (labels);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If reach here, and the loop type is UNROLL_NAIVE, then don't unroll
|
|
|
|
|
the loop unless all loops are being unrolled. */
|
cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.
* cse.c (count_reg_usage): Fix handling of REG_EQUAL notes.
* Makefile.in (loop-unroll.o): New.
* cfgloop.h (UAP_PEEL, UAP_UNROLL, UAP_UNROLL_ALL): New.
(unroll_and_peel_loops): Declare.
* alias.c (init_alias_analysis): Flag_unroll_loops renamed to
flag_old_unroll_loops.
* loop.c (loop_invariant_p): Ditto.
* unroll.c (unroll_loop): Flag_unroll_all_loops renamed to
flag_old_unroll_all_loops.
* flags.h (flag_unroll_loops): Renamed to flag_old_unroll_loops.
(flag_unroll_all_loops): Renamed to flag_old_unroll_all_loops.
* params.def (PARAM_MAX_UNROLLED_INSNS): Default value changed.
(PARAM_MAX_AVERAGE_UNROLLED_INSNS, PARAM_MAX_UNROLL_TIMES,
PARAM_MAX_PEELED_INSNS, PARAM_MAX_PEEL_TIMES,
PARAM_MAX_COMPLETELY_PEELED_INSNS, PARAM_MAX_COMPLETELY_PEEL_TIMES,
PARAM_MAX_ONCE_PEELED_INSNS): New.
* toplev.h (flag_old_unroll_loops, flag_old_unroll_all_loops): New.
(flag_unroll_loops, flag_unroll_all_loops): Used for new unroller
instead of old one.
(flag_peel_loops): New.
(lang_independent_options): The new flags added.
(rest_of_compilation): Call new unroller.
(process_options): Setup flags for coexistence of old and new unroller.
* doc/invoke.texi: Document new options.
* doc/passes.texi: Document new unroller pass.
From-SVN: r63462
2003-02-26 11:48:36 +01:00
|
|
|
|
if (unroll_type == UNROLL_NAIVE && ! flag_old_unroll_all_loops)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Unrolling failure: Naive unrolling not being done.\n");
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
goto egress;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* At this point, we are guaranteed to unroll the loop. */
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
/* Keep track of the unroll factor for the loop. */
|
loop.c (this_loop_info): New variable.
* loop.c (this_loop_info): New variable.
(loop_has_call, loop_has_volatile, loop_has_tablejump,
loop_continue, loops_enclosed): Replace with fields in this_loop_info.
All uses updated.
(prescan_loop, strength_reduce): New argument loop_info. All callers
updated.
(scan_loop): New variable loop_info, initialise to address of
this_loop_info.
(prescan_loop): Set loop_info->vtop if find NOTE_INSN_LOOP_VTOP.
Delete variable loop_has_multiple_exit targets and replace with
field in this_loop_info.
(find_and_verify_loops): Rename this_loop to this_loop_num.
(strength_reduce): Delete loop_iteration_info. Replace variable
loop_info with function argument of same name.
(insert_bct): Rework test for loop being completely unrolled.
* loop.h (struct loop_info): New fields num, loops_enclosed,
has_call, has_volatile, has_tablejump, has_multiple_exit_targets,
has_indirect_jump, and cont. Redefine use of unroll_number.
(loop_unroll_number): Delete.
* unroll.c (unroll_loop): Store loop unroll count in unroll_number
field of loop_info.
(loop_iterations): Delete variable vtop and instead use
loop_info->vtop computed in prescan_loop.
From-SVN: r28961
1999-08-29 12:09:29 +02:00
|
|
|
|
loop_info->unroll_number = unroll_number;
|
1997-08-12 06:07:19 +02:00
|
|
|
|
|
2002-07-20 02:31:15 +02:00
|
|
|
|
/* And whether the loop has been preconditioned. */
|
|
|
|
|
loop_info->preconditioned = loop_preconditioned;
|
|
|
|
|
|
2002-10-27 15:47:55 +01:00
|
|
|
|
/* Remember whether it was preconditioned for the second loop pass. */
|
2002-10-07 19:55:46 +02:00
|
|
|
|
NOTE_PRECONDITIONED (loop->end) = loop_preconditioned;
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* For each biv and giv, determine whether it can be safely split into
|
|
|
|
|
a different variable for each unrolled copy of the loop body.
|
|
|
|
|
We precalculate and save this info here, since computing it is
|
|
|
|
|
expensive.
|
|
|
|
|
|
|
|
|
|
Do this before deleting any instructions from the loop, so that
|
|
|
|
|
back_branch_in_range_p will work correctly. */
|
|
|
|
|
|
|
|
|
|
if (splitting_not_safe)
|
|
|
|
|
temp = 0;
|
|
|
|
|
else
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
temp = find_splittable_regs (loop, unroll_type, unroll_number);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* find_splittable_regs may have created some new registers, so must
|
|
|
|
|
reallocate the reg_map with the new larger size, and must realloc
|
|
|
|
|
the constant maps also. */
|
|
|
|
|
|
|
|
|
|
maxregnum = max_reg_num ();
|
1999-11-02 00:19:44 +01:00
|
|
|
|
map->reg_map = (rtx *) xmalloc (maxregnum * sizeof (rtx));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
init_reg_map (map, maxregnum);
|
|
|
|
|
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
if (map->const_equiv_varray == 0)
|
|
|
|
|
VARRAY_CONST_EQUIV_INIT (map->const_equiv_varray,
|
|
|
|
|
maxregnum + temp * unroll_number * 2,
|
|
|
|
|
"unroll_loop");
|
|
|
|
|
global_const_equiv_varray = map->const_equiv_varray;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Search the list of bivs and givs to find ones which need to be remapped
|
|
|
|
|
when split, and set their reg_map entry appropriately. */
|
|
|
|
|
|
2001-01-01 01:49:30 +01:00
|
|
|
|
for (bl = ivs->list; bl; bl = bl->next)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (REGNO (bl->biv->src_reg) != bl->regno)
|
|
|
|
|
map->reg_map[bl->regno] = bl->biv->src_reg;
|
|
|
|
|
#if 0
|
|
|
|
|
/* Currently, non-reduced/final-value givs are never split. */
|
|
|
|
|
for (v = bl->giv; v; v = v->next_iv)
|
|
|
|
|
if (REGNO (v->src_reg) != bl->regno)
|
|
|
|
|
map->reg_map[REGNO (v->dest_reg)] = v->src_reg;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
1995-12-27 21:28:09 +01:00
|
|
|
|
/* Use our current register alignment and pointer flags. */
|
1999-12-20 14:18:17 +01:00
|
|
|
|
map->regno_pointer_align = cfun->emit->regno_pointer_align;
|
2000-11-30 07:31:19 +01:00
|
|
|
|
map->x_regno_reg_rtx = cfun->emit->x_regno_reg_rtx;
|
1995-12-27 21:28:09 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* If the loop is being partially unrolled, and the iteration variables
|
|
|
|
|
are being split, and are being renamed for the split, then must fix up
|
1994-05-02 22:42:23 +02:00
|
|
|
|
the compare/jump instruction at the end of the loop to refer to the new
|
1992-02-08 04:27:38 +01:00
|
|
|
|
registers. This compare isn't copied, so the registers used in it
|
|
|
|
|
will never be replaced if it isn't done here. */
|
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_MODULO)
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (copy_end);
|
1994-05-02 22:42:23 +02:00
|
|
|
|
if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN)
|
2000-09-11 23:48:46 +02:00
|
|
|
|
PATTERN (insn) = remap_split_bivs (loop, PATTERN (insn));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
1998-12-08 15:50:03 +01:00
|
|
|
|
/* For unroll_number times, make a copy of each instruction
|
1992-02-08 04:27:38 +01:00
|
|
|
|
between copy_start and copy_end, and insert these new instructions
|
|
|
|
|
before the end of the loop. */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < unroll_number; i++)
|
|
|
|
|
{
|
alias.c [...] (init_alias_analysis, [...]): Use memset () instead of bzero ().
* alias.c (init_alias_analysis), calls.c (expand_call,
emit_library_call_value_1), combine.c (init_reg_last_arrays),
cse.c (new_basic_block), dbxout.c (dbxout_type), diagnostic.c
(init_output_buffer, set_diagnostic_context), dwarf2out.c
(equate_decl_number_to_die, build_abbrev_table), emit-rtl.c
(init_emit_once), fold-const.c (mul_double, div_and_round_double),
function.c (assign_parms), gcse.c (compute_can_copy,
alloc_gcse_mem, alloc_reg_set_mem, record_one_set,
compute_hash_table, compute_set_hash_table,
compute_expr_hash_table), genattrtab.c (optimize_attrs), global.c
(global_alloc, global_conflicts), haifa-sched.c (compute_trg_info,
clear_units, schedule_block), integrate.c (initialize_for_inline,
expand_inline_function), jump.c (thread_jumps), local-alloc.c
(local_alloc), loop.c (combine_movables, count_loop_regs_set,
load_mems_and_recount_loop_regs_set), print-tree.c (debug_tree),
regclass.c (init_reg_sets, init_reg_sets_1, regclass,
record_reg_classes, allocate_reg_info), reload.c
(get_secondary_mem, remove_address_replacements, find_reloads),
reload1.c (reload, set_initial_label_offsets, finish_spills,
reload_as_needed, choose_reload_regs_init,
reload_cse_simplify_operands), reorg.c (dbr_schedule), sbitmap.c
(sbitmap_zero), simplify-rtx.c (simplify_plus_minus), ssa.c
(rename_registers), stmt.c (expand_end_case), unroll.c
(unroll_loop), varray.c (varray_grow), objc/objc-act.c: Use memset
() instead of bzero ().
ch:
* actions.c (check_missing_cases), typeck.c (build_chill_slice,
build_chill_cast): Use memset () instead of bzero ().
cp:
* class.c (duplicate_tag_error, build_vtbl_initializer), decl.c
(push_binding_level), error.c (cp_tree_printer), pt.c
(process_partial_specialization, tsubst_template_arg_vector),
search.c (lookup_member): Use memset () instead of bzero ().
java:
* expr.c (note_instructions), jcf-io.c (find_class), jcf-parse.c
(init_outgoing_cpool), lex.c (java_init_lex): Use memset ()
instead of bzero ().
From-SVN: r37303
2000-11-07 23:50:06 +01:00
|
|
|
|
memset ((char *) map->insn_map, 0, max_insnno * sizeof (rtx));
|
|
|
|
|
memset ((char *) &VARRAY_CONST_EQUIV (map->const_equiv_varray, 0), 0,
|
|
|
|
|
VARRAY_SIZE (map->const_equiv_varray) * sizeof (struct const_equiv_data));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
map->const_age = 0;
|
|
|
|
|
|
|
|
|
|
for (j = 0; j < max_labelno; j++)
|
|
|
|
|
if (local_label[j])
|
1997-12-18 23:42:41 +01:00
|
|
|
|
set_label_in_map (map, j, gen_label_rtx ());
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
for (r = FIRST_PSEUDO_REGISTER; r < max_local_regnum; r++)
|
|
|
|
|
if (local_regno[r])
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
map->reg_map[r] = gen_reg_rtx (GET_MODE (regno_reg_rtx[r]));
|
|
|
|
|
record_base_value (REGNO (map->reg_map[r]),
|
|
|
|
|
regno_reg_rtx[r], 0);
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
}
|
1995-05-10 16:33:50 +02:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* If loop starts with a branch to the test, then fix it so that
|
|
|
|
|
it points to the test of the first unrolled copy of the loop. */
|
|
|
|
|
if (i == 0 && loop_start != copy_start)
|
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (copy_start);
|
|
|
|
|
pattern = PATTERN (insn);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1997-12-18 23:42:41 +01:00
|
|
|
|
tem = get_label_from_map (map,
|
|
|
|
|
CODE_LABEL_NUMBER
|
|
|
|
|
(XEXP (SET_SRC (pattern), 0)));
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
SET_SRC (pattern) = gen_rtx_LABEL_REF (VOIDmode, tem);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Set the jump label so that it can be used by later loop unrolling
|
|
|
|
|
passes. */
|
|
|
|
|
JUMP_LABEL (insn) = tem;
|
|
|
|
|
LABEL_NUSES (tem)++;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-11 23:48:46 +02:00
|
|
|
|
copy_loop_body (loop, copy_start, copy_end, map, exit_label,
|
1992-02-08 04:27:38 +01:00
|
|
|
|
i == unroll_number - 1, unroll_type, start_label,
|
|
|
|
|
loop_end, insert_before, insert_before);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Before deleting any insns, emit a CODE_LABEL immediately after the last
|
|
|
|
|
insn to be deleted. This prevents any runaway delete_insn call from
|
|
|
|
|
more insns that it should, as it always stops at a CODE_LABEL. */
|
|
|
|
|
|
|
|
|
|
/* Delete the compare and branch at the end of the loop if completely
|
|
|
|
|
unrolling the loop. Deleting the backward branch at the end also
|
|
|
|
|
deletes the code label at the start of the loop. This is done at
|
|
|
|
|
the very end to avoid problems with back_branch_in_range_p. */
|
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY)
|
|
|
|
|
safety_label = emit_label_after (gen_label_rtx (), last_loop_insn);
|
|
|
|
|
else
|
|
|
|
|
safety_label = emit_label_after (gen_label_rtx (), copy_end);
|
|
|
|
|
|
1999-02-04 23:55:55 +01:00
|
|
|
|
/* Delete all of the original loop instructions. Don't delete the
|
1992-02-08 04:27:38 +01:00
|
|
|
|
LOOP_BEG note, or the first code label in the loop. */
|
|
|
|
|
|
|
|
|
|
insn = NEXT_INSN (copy_start);
|
|
|
|
|
while (insn != safety_label)
|
|
|
|
|
{
|
1999-07-09 21:12:30 +02:00
|
|
|
|
/* ??? Don't delete named code labels. They will be deleted when the
|
|
|
|
|
jump that references them is deleted. Otherwise, we end up deleting
|
|
|
|
|
them twice, which causes them to completely disappear instead of turn
|
|
|
|
|
into NOTE_INSN_DELETED_LABEL notes. This in turn causes aborts in
|
|
|
|
|
dwarfout.c/dwarf2out.c. We could perhaps fix the dwarf*out.c files
|
|
|
|
|
to handle deleted labels instead. Or perhaps fix DECL_RTL of the
|
|
|
|
|
associated LABEL_DECL to point to one of the new label instances. */
|
|
|
|
|
/* ??? Likewise, we can't delete a NOTE_INSN_DELETED_LABEL note. */
|
1999-07-07 02:41:18 +02:00
|
|
|
|
if (insn != start_label
|
1999-07-09 21:12:30 +02:00
|
|
|
|
&& ! (GET_CODE (insn) == CODE_LABEL && LABEL_NAME (insn))
|
1999-07-07 02:41:18 +02:00
|
|
|
|
&& ! (GET_CODE (insn) == NOTE
|
|
|
|
|
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
insn = delete_related_insns (insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Can now delete the 'safety' label emitted to protect us from runaway
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns calls. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (INSN_DELETED_P (safety_label))
|
|
|
|
|
abort ();
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (safety_label);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* If exit_label exists, emit it after the loop. Doing the emit here
|
|
|
|
|
forces it to have a higher INSN_UID than any insn in the unrolled loop.
|
|
|
|
|
This is needed so that mostly_true_jump in reorg.c will treat jumps
|
|
|
|
|
to this loop end label correctly, i.e. predict that they are usually
|
|
|
|
|
not taken. */
|
|
|
|
|
if (exit_label)
|
|
|
|
|
emit_label_after (exit_label, loop_end);
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
|
|
|
|
|
egress:
|
1999-11-02 17:37:23 +01:00
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY)
|
|
|
|
|
{
|
|
|
|
|
/* Remove the loop notes since this is no longer a loop. */
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
if (loop->vtop)
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (loop->vtop);
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
if (loop->cont)
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (loop->cont);
|
1999-11-02 17:37:23 +01:00
|
|
|
|
if (loop_start)
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (loop_start);
|
1999-11-02 17:37:23 +01:00
|
|
|
|
if (loop_end)
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (loop_end);
|
1999-11-02 17:37:23 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-11-02 00:19:44 +01:00
|
|
|
|
if (map->const_equiv_varray)
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
VARRAY_FREE (map->const_equiv_varray);
|
1999-11-02 00:19:44 +01:00
|
|
|
|
if (map->label_map)
|
|
|
|
|
{
|
|
|
|
|
free (map->label_map);
|
|
|
|
|
free (local_label);
|
|
|
|
|
}
|
|
|
|
|
free (map->insn_map);
|
|
|
|
|
free (splittable_regs);
|
|
|
|
|
free (splittable_regs_updates);
|
|
|
|
|
free (addr_combined_regs);
|
|
|
|
|
free (local_regno);
|
|
|
|
|
if (map->reg_map)
|
|
|
|
|
free (map->reg_map);
|
|
|
|
|
free (map);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
2002-09-28 00:41:07 +02:00
|
|
|
|
|
|
|
|
|
/* A helper function for unroll_loop. Emit a compare and branch to
|
|
|
|
|
satisfy (CMP OP1 OP2), but pass this through the simplifier first.
|
|
|
|
|
If the branch turned out to be conditional, return it, otherwise
|
|
|
|
|
return NULL. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
simplify_cmp_and_jump_insns (code, mode, op0, op1, label)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op0, op1, label;
|
|
|
|
|
{
|
|
|
|
|
rtx t, insn;
|
|
|
|
|
|
|
|
|
|
t = simplify_relational_operation (code, mode, op0, op1);
|
|
|
|
|
if (!t)
|
|
|
|
|
{
|
|
|
|
|
enum rtx_code scode = signed_condition (code);
|
|
|
|
|
emit_cmp_and_jump_insns (op0, op1, scode, NULL_RTX, mode,
|
|
|
|
|
code != scode, label);
|
|
|
|
|
insn = get_last_insn ();
|
|
|
|
|
|
|
|
|
|
JUMP_LABEL (insn) = label;
|
|
|
|
|
LABEL_NUSES (label) += 1;
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
else if (t == const_true_rtx)
|
|
|
|
|
{
|
|
|
|
|
insn = emit_jump_insn (gen_jump (label));
|
|
|
|
|
emit_barrier ();
|
|
|
|
|
JUMP_LABEL (insn) = label;
|
|
|
|
|
LABEL_NUSES (label) += 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Return true if the loop can be safely, and profitably, preconditioned
|
|
|
|
|
so that the unrolled copies of the loop body don't need exit tests.
|
|
|
|
|
|
|
|
|
|
This only works if final_value, initial_value and increment can be
|
|
|
|
|
determined, and if increment is a constant power of 2.
|
|
|
|
|
If increment is not a power of 2, then the preconditioning modulo
|
|
|
|
|
operation would require a real modulo instead of a boolean AND, and this
|
|
|
|
|
is not considered `profitable'. */
|
|
|
|
|
|
|
|
|
|
/* ??? If the loop is known to be executed very many times, or the machine
|
|
|
|
|
has a very cheap divide instruction, then preconditioning is a win even
|
|
|
|
|
when the increment is not a power of 2. Use RTX_COST to compute
|
1998-12-08 15:50:03 +01:00
|
|
|
|
whether divide is cheap.
|
|
|
|
|
??? A divide by constant doesn't actually need a divide, look at
|
|
|
|
|
expand_divmod. The reduced cost of this optimized modulo is not
|
|
|
|
|
reflected in RTX_COST. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
int
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
precondition_loop_p (loop, initial_value, final_value, increment, mode)
|
|
|
|
|
const struct loop *loop;
|
1998-11-25 22:19:21 +01:00
|
|
|
|
rtx *initial_value, *final_value, *increment;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
enum machine_mode *mode;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
rtx loop_start = loop->start;
|
|
|
|
|
struct loop_info *loop_info = LOOP_INFO (loop);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (loop_info->n_iterations > 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
2002-01-10 22:00:43 +01:00
|
|
|
|
if (INTVAL (loop_info->increment) > 0)
|
|
|
|
|
{
|
|
|
|
|
*initial_value = const0_rtx;
|
|
|
|
|
*increment = const1_rtx;
|
|
|
|
|
*final_value = GEN_INT (loop_info->n_iterations);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
*initial_value = GEN_INT (loop_info->n_iterations);
|
|
|
|
|
*increment = constm1_rtx;
|
|
|
|
|
*final_value = const0_rtx;
|
|
|
|
|
}
|
1998-11-25 22:32:27 +01:00
|
|
|
|
*mode = word_mode;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
1998-06-22 07:32:38 +02:00
|
|
|
|
{
|
|
|
|
|
fputs ("Preconditioning: Success, number of iterations known, ",
|
|
|
|
|
loop_dump_stream);
|
|
|
|
|
fprintf (loop_dump_stream, HOST_WIDE_INT_PRINT_DEC,
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->n_iterations);
|
1998-06-22 07:32:38 +02:00
|
|
|
|
fputs (".\n", loop_dump_stream);
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2001-01-16 12:15:49 +01:00
|
|
|
|
if (loop_info->iteration_var == 0)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Could not find iteration variable.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else if (loop_info->initial_value == 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Could not find initial value.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1998-11-25 22:19:21 +01:00
|
|
|
|
else if (loop_info->increment == 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Could not find increment value.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1998-11-25 22:19:21 +01:00
|
|
|
|
else if (GET_CODE (loop_info->increment) != CONST_INT)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Increment not a constant.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1998-11-25 22:19:21 +01:00
|
|
|
|
else if ((exact_log2 (INTVAL (loop_info->increment)) < 0)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
&& (exact_log2 (-INTVAL (loop_info->increment)) < 0))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Increment not a constant power of 2.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Unsigned_compare and compare_dir can be ignored here, since they do
|
|
|
|
|
not matter for preconditioning. */
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (loop_info->final_value == 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: EQ comparison loop.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
/* Must ensure that final_value is invariant, so call
|
|
|
|
|
loop_invariant_p to check. Before doing so, must check regno
|
|
|
|
|
against max_reg_before_loop to make sure that the register is in
|
|
|
|
|
the range covered by loop_invariant_p. If it isn't, then it is
|
|
|
|
|
most likely a biv/giv which by definition are not invariant. */
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if ((GET_CODE (loop_info->final_value) == REG
|
|
|
|
|
&& REGNO (loop_info->final_value) >= max_reg_before_loop)
|
|
|
|
|
|| (GET_CODE (loop_info->final_value) == PLUS
|
|
|
|
|
&& REGNO (XEXP (loop_info->final_value, 0)) >= max_reg_before_loop)
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
|| ! loop_invariant_p (loop, loop_info->final_value))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Final value not invariant.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Fail for floating point values, since the caller of this function
|
|
|
|
|
does not have code to deal with them. */
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (GET_MODE_CLASS (GET_MODE (loop_info->final_value)) == MODE_FLOAT
|
|
|
|
|
|| GET_MODE_CLASS (GET_MODE (loop_info->initial_value)) == MODE_FLOAT)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Floating point final or initial value.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
/* Fail if loop_info->iteration_var is not live before loop_start,
|
|
|
|
|
since we need to test its value in the preconditioning code. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2001-01-01 01:14:30 +01:00
|
|
|
|
if (REGNO_FIRST_LUID (REGNO (loop_info->iteration_var))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
> INSN_LUID (loop_start))
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Preconditioning: Iteration var not live before loop start.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-11 23:44:21 +02:00
|
|
|
|
/* Note that loop_iterations biases the initial value for GIV iterators
|
1999-02-24 12:50:54 +01:00
|
|
|
|
such as "while (i-- > 0)" so that we can calculate the number of
|
|
|
|
|
iterations just like for BIV iterators.
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-11-25 21:51:09 +01:00
|
|
|
|
Also note that the absolute values of initial_value and
|
|
|
|
|
final_value are unimportant as only their difference is used for
|
|
|
|
|
calculating the number of loop iterations. */
|
1998-11-25 22:19:21 +01:00
|
|
|
|
*initial_value = loop_info->initial_value;
|
|
|
|
|
*increment = loop_info->increment;
|
|
|
|
|
*final_value = loop_info->final_value;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
/* Decide what mode to do these calculations in. Choose the larger
|
|
|
|
|
of final_value's mode and initial_value's mode, or a full-word if
|
|
|
|
|
both are constants. */
|
|
|
|
|
*mode = GET_MODE (*final_value);
|
|
|
|
|
if (*mode == VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
*mode = GET_MODE (*initial_value);
|
|
|
|
|
if (*mode == VOIDmode)
|
|
|
|
|
*mode = word_mode;
|
|
|
|
|
}
|
|
|
|
|
else if (*mode != GET_MODE (*initial_value)
|
|
|
|
|
&& (GET_MODE_SIZE (*mode)
|
|
|
|
|
< GET_MODE_SIZE (GET_MODE (*initial_value))))
|
|
|
|
|
*mode = GET_MODE (*initial_value);
|
|
|
|
|
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
/* Success! */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream, "Preconditioning: Successful.\n");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* All pseudo-registers must be mapped to themselves. Two hard registers
|
|
|
|
|
must be mapped, VIRTUAL_STACK_VARS_REGNUM and VIRTUAL_INCOMING_ARGS_
|
|
|
|
|
REGNUM, to avoid function-inlining specific conversions of these
|
|
|
|
|
registers. All other hard regs can not be mapped because they may be
|
|
|
|
|
used with different
|
|
|
|
|
modes. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
init_reg_map (map, maxregnum)
|
|
|
|
|
struct inline_remap *map;
|
|
|
|
|
int maxregnum;
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = maxregnum - 1; i > LAST_VIRTUAL_REGISTER; i--)
|
|
|
|
|
map->reg_map[i] = regno_reg_rtx[i];
|
|
|
|
|
/* Just clear the rest of the entries. */
|
|
|
|
|
for (i = LAST_VIRTUAL_REGISTER; i >= 0; i--)
|
|
|
|
|
map->reg_map[i] = 0;
|
|
|
|
|
|
|
|
|
|
map->reg_map[VIRTUAL_STACK_VARS_REGNUM]
|
|
|
|
|
= regno_reg_rtx[VIRTUAL_STACK_VARS_REGNUM];
|
|
|
|
|
map->reg_map[VIRTUAL_INCOMING_ARGS_REGNUM]
|
|
|
|
|
= regno_reg_rtx[VIRTUAL_INCOMING_ARGS_REGNUM];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Strength-reduction will often emit code for optimized biv/givs which
|
|
|
|
|
calculates their value in a temporary register, and then copies the result
|
|
|
|
|
to the iv. This procedure reconstructs the pattern computing the iv;
|
|
|
|
|
verifying that all operands are of the proper form.
|
|
|
|
|
|
1998-04-04 15:32:39 +02:00
|
|
|
|
PATTERN must be the result of single_set.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
The return value is the amount that the giv is incremented by. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
calculate_giv_inc (pattern, src_insn, regno)
|
|
|
|
|
rtx pattern, src_insn;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int regno;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
rtx increment;
|
1993-06-17 23:31:32 +02:00
|
|
|
|
rtx increment_total = 0;
|
|
|
|
|
int tries = 0;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1993-06-17 23:31:32 +02:00
|
|
|
|
retry:
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Verify that we have an increment insn here. First check for a plus
|
|
|
|
|
as the set source. */
|
|
|
|
|
if (GET_CODE (SET_SRC (pattern)) != PLUS)
|
|
|
|
|
{
|
|
|
|
|
/* SR sometimes computes the new giv value in a temp, then copies it
|
|
|
|
|
to the new_reg. */
|
|
|
|
|
src_insn = PREV_INSN (src_insn);
|
2001-11-04 09:12:09 +01:00
|
|
|
|
pattern = single_set (src_insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (SET_SRC (pattern)) != PLUS)
|
|
|
|
|
abort ();
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The last insn emitted is not needed, so delete it to avoid confusing
|
|
|
|
|
the second cse pass. This insn sets the giv unnecessarily. */
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (get_last_insn ());
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Verify that we have a constant as the second operand of the plus. */
|
|
|
|
|
increment = XEXP (SET_SRC (pattern), 1);
|
|
|
|
|
if (GET_CODE (increment) != CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
/* SR sometimes puts the constant in a register, especially if it is
|
|
|
|
|
too big to be an add immed operand. */
|
2001-11-04 09:12:09 +01:00
|
|
|
|
increment = find_last_value (increment, &src_insn, NULL_RTX, 0);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* SR may have used LO_SUM to compute the constant if it is too large
|
|
|
|
|
for a load immed operand. In this case, the constant is in operand
|
|
|
|
|
one of the LO_SUM rtx. */
|
|
|
|
|
if (GET_CODE (increment) == LO_SUM)
|
|
|
|
|
increment = XEXP (increment, 1);
|
1997-12-18 18:31:01 +01:00
|
|
|
|
|
|
|
|
|
/* Some ports store large constants in memory and add a REG_EQUAL
|
|
|
|
|
note to the store insn. */
|
|
|
|
|
else if (GET_CODE (increment) == MEM)
|
1999-02-04 23:55:55 +01:00
|
|
|
|
{
|
|
|
|
|
rtx note = find_reg_note (src_insn, REG_EQUAL, 0);
|
|
|
|
|
if (note)
|
|
|
|
|
increment = XEXP (note, 0);
|
|
|
|
|
}
|
1997-12-18 18:31:01 +01:00
|
|
|
|
|
1995-08-19 23:34:03 +02:00
|
|
|
|
else if (GET_CODE (increment) == IOR
|
2003-03-08 08:32:36 +01:00
|
|
|
|
|| GET_CODE (increment) == PLUS
|
1997-08-31 07:57:40 +02:00
|
|
|
|
|| GET_CODE (increment) == ASHIFT
|
2003-03-08 08:32:36 +01:00
|
|
|
|
|| GET_CODE (increment) == LSHIFTRT)
|
1994-08-15 00:55:17 +02:00
|
|
|
|
{
|
1995-08-19 23:34:03 +02:00
|
|
|
|
/* The rs6000 port loads some constants with IOR.
|
2003-03-08 08:32:36 +01:00
|
|
|
|
The alpha port loads some constants with ASHIFT and PLUS.
|
|
|
|
|
The sparc64 port loads some constants with LSHIFTRT. */
|
1994-08-15 00:55:17 +02:00
|
|
|
|
rtx second_part = XEXP (increment, 1);
|
1995-08-19 23:34:03 +02:00
|
|
|
|
enum rtx_code code = GET_CODE (increment);
|
1994-08-15 00:55:17 +02:00
|
|
|
|
|
2002-06-01 00:15:42 +02:00
|
|
|
|
increment = find_last_value (XEXP (increment, 0),
|
2001-11-04 09:12:09 +01:00
|
|
|
|
&src_insn, NULL_RTX, 0);
|
1994-08-15 00:55:17 +02:00
|
|
|
|
/* Don't need the last insn anymore. */
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (get_last_insn ());
|
1994-08-15 00:55:17 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (second_part) != CONST_INT
|
|
|
|
|
|| GET_CODE (increment) != CONST_INT)
|
|
|
|
|
abort ();
|
|
|
|
|
|
1995-08-19 23:34:03 +02:00
|
|
|
|
if (code == IOR)
|
|
|
|
|
increment = GEN_INT (INTVAL (increment) | INTVAL (second_part));
|
1997-08-31 07:57:40 +02:00
|
|
|
|
else if (code == PLUS)
|
|
|
|
|
increment = GEN_INT (INTVAL (increment) + INTVAL (second_part));
|
2003-03-08 08:32:36 +01:00
|
|
|
|
else if (code == ASHIFT)
|
1995-08-19 23:34:03 +02:00
|
|
|
|
increment = GEN_INT (INTVAL (increment) << INTVAL (second_part));
|
2003-03-08 08:32:36 +01:00
|
|
|
|
else
|
|
|
|
|
increment = GEN_INT ((unsigned HOST_WIDE_INT) INTVAL (increment) >> INTVAL (second_part));
|
1994-08-15 00:55:17 +02:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (increment) != CONST_INT)
|
|
|
|
|
abort ();
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1994-08-15 00:55:17 +02:00
|
|
|
|
/* The insn loading the constant into a register is no longer needed,
|
1992-02-08 04:27:38 +01:00
|
|
|
|
so delete it. */
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (get_last_insn ());
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
1993-06-17 23:31:32 +02:00
|
|
|
|
if (increment_total)
|
|
|
|
|
increment_total = GEN_INT (INTVAL (increment_total) + INTVAL (increment));
|
|
|
|
|
else
|
|
|
|
|
increment_total = increment;
|
|
|
|
|
|
|
|
|
|
/* Check that the source register is the same as the register we expected
|
|
|
|
|
to see as the source. If not, something is seriously wrong. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (XEXP (SET_SRC (pattern), 0)) != REG
|
|
|
|
|
|| REGNO (XEXP (SET_SRC (pattern), 0)) != regno)
|
1993-06-17 23:31:32 +02:00
|
|
|
|
{
|
|
|
|
|
/* Some machines (e.g. the romp), may emit two add instructions for
|
|
|
|
|
certain constants, so lets try looking for another add immediately
|
|
|
|
|
before this one if we have only seen one add insn so far. */
|
|
|
|
|
|
|
|
|
|
if (tries == 0)
|
|
|
|
|
{
|
|
|
|
|
tries++;
|
|
|
|
|
|
|
|
|
|
src_insn = PREV_INSN (src_insn);
|
2001-11-04 09:12:09 +01:00
|
|
|
|
pattern = single_set (src_insn);
|
1993-06-17 23:31:32 +02:00
|
|
|
|
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (get_last_insn ());
|
1993-06-17 23:31:32 +02:00
|
|
|
|
|
|
|
|
|
goto retry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1993-06-17 23:31:32 +02:00
|
|
|
|
return increment_total;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
1993-05-17 01:14:24 +02:00
|
|
|
|
/* Copy REG_NOTES, except for insn references, because not all insn_map
|
|
|
|
|
entries are valid yet. We do need to copy registers now though, because
|
|
|
|
|
the reg_map entries can change during copying. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
initial_reg_note_copy (notes, map)
|
|
|
|
|
rtx notes;
|
|
|
|
|
struct inline_remap *map;
|
|
|
|
|
{
|
|
|
|
|
rtx copy;
|
|
|
|
|
|
|
|
|
|
if (notes == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
copy = rtx_alloc (GET_CODE (notes));
|
2001-06-12 06:42:46 +02:00
|
|
|
|
PUT_REG_NOTE_KIND (copy, REG_NOTE_KIND (notes));
|
1993-05-17 01:14:24 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (notes) == EXPR_LIST)
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
XEXP (copy, 0) = copy_rtx_and_substitute (XEXP (notes, 0), map, 0);
|
1993-05-17 01:14:24 +02:00
|
|
|
|
else if (GET_CODE (notes) == INSN_LIST)
|
|
|
|
|
/* Don't substitute for these yet. */
|
2001-04-21 20:45:00 +02:00
|
|
|
|
XEXP (copy, 0) = copy_rtx (XEXP (notes, 0));
|
1993-05-17 01:14:24 +02:00
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
XEXP (copy, 1) = initial_reg_note_copy (XEXP (notes, 1), map);
|
|
|
|
|
|
|
|
|
|
return copy;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Fixup insn references in copied REG_NOTES. */
|
|
|
|
|
|
|
|
|
|
static void
|
2001-06-12 06:42:46 +02:00
|
|
|
|
final_reg_note_copy (notesp, map)
|
|
|
|
|
rtx *notesp;
|
1993-05-17 01:14:24 +02:00
|
|
|
|
struct inline_remap *map;
|
|
|
|
|
{
|
2001-06-12 06:42:46 +02:00
|
|
|
|
while (*notesp)
|
|
|
|
|
{
|
|
|
|
|
rtx note = *notesp;
|
2002-06-01 00:15:42 +02:00
|
|
|
|
|
2001-06-12 06:42:46 +02:00
|
|
|
|
if (GET_CODE (note) == INSN_LIST)
|
|
|
|
|
{
|
|
|
|
|
/* Sometimes, we have a REG_WAS_0 note that points to a
|
|
|
|
|
deleted instruction. In that case, we can just delete the
|
|
|
|
|
note. */
|
|
|
|
|
if (REG_NOTE_KIND (note) == REG_WAS_0)
|
|
|
|
|
{
|
|
|
|
|
*notesp = XEXP (note, 1);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx insn = map->insn_map[INSN_UID (XEXP (note, 0))];
|
|
|
|
|
|
2002-01-15 00:58:20 +01:00
|
|
|
|
/* If we failed to remap the note, something is awry.
|
|
|
|
|
Allow REG_LABEL as it may reference label outside
|
|
|
|
|
the unrolled loop. */
|
2001-06-12 06:42:46 +02:00
|
|
|
|
if (!insn)
|
2002-01-15 00:58:20 +01:00
|
|
|
|
{
|
|
|
|
|
if (REG_NOTE_KIND (note) != REG_LABEL)
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
XEXP (note, 0) = insn;
|
2001-06-12 06:42:46 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1993-05-17 01:14:24 +02:00
|
|
|
|
|
2001-06-12 06:42:46 +02:00
|
|
|
|
notesp = &XEXP (note, 1);
|
|
|
|
|
}
|
1993-05-17 01:14:24 +02:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Copy each instruction in the loop, substituting from map as appropriate.
|
|
|
|
|
This is very similar to a loop in expand_inline_function. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
static void
|
2000-09-11 23:48:46 +02:00
|
|
|
|
copy_loop_body (loop, copy_start, copy_end, map, exit_label, last_iteration,
|
1992-02-08 04:27:38 +01:00
|
|
|
|
unroll_type, start_label, loop_end, insert_before,
|
|
|
|
|
copy_notes_from)
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx copy_start, copy_end;
|
|
|
|
|
struct inline_remap *map;
|
1992-08-19 19:37:07 +02:00
|
|
|
|
rtx exit_label;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
int last_iteration;
|
|
|
|
|
enum unroll_types unroll_type;
|
|
|
|
|
rtx start_label, loop_end, insert_before, copy_notes_from;
|
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx insn, pattern;
|
2000-01-04 17:29:41 +01:00
|
|
|
|
rtx set, tem, copy = NULL_RTX;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
int dest_reg_was_split, i;
|
1998-02-28 08:06:53 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx cc0_insn = 0;
|
1998-02-28 08:06:53 +01:00
|
|
|
|
#endif
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx final_label = 0;
|
|
|
|
|
rtx giv_inc, giv_dest_reg, giv_src_reg;
|
|
|
|
|
|
|
|
|
|
/* If this isn't the last iteration, then map any references to the
|
|
|
|
|
start_label to final_label. Final label will then be emitted immediately
|
|
|
|
|
after the end of this loop body if it was ever used.
|
|
|
|
|
|
|
|
|
|
If this is the last iteration, then map references to the start_label
|
|
|
|
|
to itself. */
|
|
|
|
|
if (! last_iteration)
|
|
|
|
|
{
|
|
|
|
|
final_label = gen_label_rtx ();
|
2000-09-12 16:43:25 +02:00
|
|
|
|
set_label_in_map (map, CODE_LABEL_NUMBER (start_label), final_label);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
1997-12-18 23:42:41 +01:00
|
|
|
|
set_label_in_map (map, CODE_LABEL_NUMBER (start_label), start_label);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
start_sequence ();
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
insn = copy_start;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
map->orig_asm_operands_vector = 0;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
switch (GET_CODE (insn))
|
|
|
|
|
{
|
|
|
|
|
case INSN:
|
|
|
|
|
pattern = PATTERN (insn);
|
|
|
|
|
copy = 0;
|
|
|
|
|
giv_inc = 0;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Check to see if this is a giv that has been combined with
|
1999-02-04 23:55:55 +01:00
|
|
|
|
some split address givs. (Combined in the sense that
|
1992-02-08 04:27:38 +01:00
|
|
|
|
`combine_givs' in loop.c has put two givs in the same register.)
|
|
|
|
|
In this case, we must search all givs based on the same biv to
|
|
|
|
|
find the address givs. Then split the address givs.
|
|
|
|
|
Do this before splitting the giv, since that may map the
|
|
|
|
|
SET_DEST to a new register. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-04-04 15:32:39 +02:00
|
|
|
|
if ((set = single_set (insn))
|
|
|
|
|
&& GET_CODE (SET_DEST (set)) == REG
|
|
|
|
|
&& addr_combined_regs[REGNO (SET_DEST (set))])
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
struct iv_class *bl;
|
|
|
|
|
struct induction *v, *tv;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int regno = REGNO (SET_DEST (set));
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-04-04 15:32:39 +02:00
|
|
|
|
v = addr_combined_regs[REGNO (SET_DEST (set))];
|
2001-01-01 01:37:09 +01:00
|
|
|
|
bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Although the giv_inc amount is not needed here, we must call
|
|
|
|
|
calculate_giv_inc here since it might try to delete the
|
|
|
|
|
last insn emitted. If we wait until later to call it,
|
|
|
|
|
we might accidentally delete insns generated immediately
|
|
|
|
|
below by emit_unrolled_add. */
|
|
|
|
|
|
2000-09-19 18:01:13 +02:00
|
|
|
|
giv_inc = calculate_giv_inc (set, insn, regno);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Now find all address giv's that were combined with this
|
|
|
|
|
giv 'v'. */
|
|
|
|
|
for (tv = bl->giv; tv; tv = tv->next_iv)
|
|
|
|
|
if (tv->giv_type == DEST_ADDR && tv->same == v)
|
|
|
|
|
{
|
1996-05-19 02:16:38 +02:00
|
|
|
|
int this_giv_inc;
|
|
|
|
|
|
|
|
|
|
/* If this DEST_ADDR giv was not split, then ignore it. */
|
|
|
|
|
if (*tv->location != tv->dest_reg)
|
|
|
|
|
continue;
|
1992-05-20 02:20:55 +02:00
|
|
|
|
|
|
|
|
|
/* Scale this_giv_inc if the multiplicative factors of
|
|
|
|
|
the two givs are different. */
|
1996-05-19 02:16:38 +02:00
|
|
|
|
this_giv_inc = INTVAL (giv_inc);
|
1992-05-20 02:20:55 +02:00
|
|
|
|
if (tv->mult_val != v->mult_val)
|
|
|
|
|
this_giv_inc = (this_giv_inc / INTVAL (v->mult_val)
|
|
|
|
|
* INTVAL (tv->mult_val));
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-05-20 02:20:55 +02:00
|
|
|
|
tv->dest_reg = plus_constant (tv->dest_reg, this_giv_inc);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
*tv->location = tv->dest_reg;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (last_iteration && unroll_type != UNROLL_COMPLETELY)
|
|
|
|
|
{
|
|
|
|
|
/* Must emit an insn to increment the split address
|
|
|
|
|
giv. Add in the const_adjust field in case there
|
|
|
|
|
was a constant eliminated from the address. */
|
|
|
|
|
rtx value, dest_reg;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* tv->dest_reg will be either a bare register,
|
|
|
|
|
or else a register plus a constant. */
|
|
|
|
|
if (GET_CODE (tv->dest_reg) == REG)
|
|
|
|
|
dest_reg = tv->dest_reg;
|
|
|
|
|
else
|
|
|
|
|
dest_reg = XEXP (tv->dest_reg, 0);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1994-04-21 21:51:01 +02:00
|
|
|
|
/* Check for shared address givs, and avoid
|
1995-05-16 14:39:54 +02:00
|
|
|
|
incrementing the shared pseudo reg more than
|
1994-04-21 21:51:01 +02:00
|
|
|
|
once. */
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
if (! tv->same_insn && ! tv->shared)
|
1994-04-21 21:51:01 +02:00
|
|
|
|
{
|
|
|
|
|
/* tv->dest_reg may actually be a (PLUS (REG)
|
|
|
|
|
(CONST)) here, so we must call plus_constant
|
|
|
|
|
to add the const_adjust amount before calling
|
|
|
|
|
emit_unrolled_add below. */
|
|
|
|
|
value = plus_constant (tv->dest_reg,
|
|
|
|
|
tv->const_adjust);
|
|
|
|
|
|
1999-12-18 20:59:24 +01:00
|
|
|
|
if (GET_CODE (value) == PLUS)
|
|
|
|
|
{
|
|
|
|
|
/* The constant could be too large for an add
|
|
|
|
|
immediate, so can't directly emit an insn
|
|
|
|
|
here. */
|
|
|
|
|
emit_unrolled_add (dest_reg, XEXP (value, 0),
|
|
|
|
|
XEXP (value, 1));
|
|
|
|
|
}
|
1994-04-21 21:51:01 +02:00
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Reset the giv to be just the register again, in case
|
1992-03-03 14:06:22 +01:00
|
|
|
|
it is used after the set we have just emitted.
|
|
|
|
|
We must subtract the const_adjust factor added in
|
|
|
|
|
above. */
|
|
|
|
|
tv->dest_reg = plus_constant (dest_reg,
|
2000-09-12 16:43:25 +02:00
|
|
|
|
-tv->const_adjust);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
*tv->location = tv->dest_reg;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* If this is a setting of a splittable variable, then determine
|
|
|
|
|
how to split the variable, create a new set based on this split,
|
|
|
|
|
and set up the reg_map so that later uses of the variable will
|
|
|
|
|
use the new split variable. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
dest_reg_was_split = 0;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-04-04 15:32:39 +02:00
|
|
|
|
if ((set = single_set (insn))
|
|
|
|
|
&& GET_CODE (SET_DEST (set)) == REG
|
|
|
|
|
&& splittable_regs[REGNO (SET_DEST (set))])
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned int regno = REGNO (SET_DEST (set));
|
|
|
|
|
unsigned int src_regno;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
dest_reg_was_split = 1;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-04-04 15:32:39 +02:00
|
|
|
|
giv_dest_reg = SET_DEST (set);
|
2000-09-19 18:01:13 +02:00
|
|
|
|
giv_src_reg = giv_dest_reg;
|
|
|
|
|
/* Compute the increment value for the giv, if it wasn't
|
|
|
|
|
already computed above. */
|
|
|
|
|
if (giv_inc == 0)
|
|
|
|
|
giv_inc = calculate_giv_inc (set, insn, regno);
|
|
|
|
|
|
rtl.h (insn_first_p): Declare.
* rtl.h (insn_first_p): Declare.
* rtlanal.c (insn_first_p): New function.
* loop.h (varray.h): Include.
(struct induction): Change combined_with to unsigned.
New members derived, ix and last_use.
(reg_iv_type, reg_iv_info): Now varray_type. All references changed.
(REG_IV_TYPE, REG_IV_INFO): Define.
(first_increment_giv, last_increment_giv): Declare.
* loop.c (loop_number_loop_cont): New static variable.
(loop_number_cont_dominator): Likewise.
(reg_iv_type, reg_iv_info): Now varray_type.
(first_increment_giv, last_increment_giv): New variables.
(compute_luids, verify_dominator, find_life_end): New functions.
(cmp_recombine_givs_stats, recombine_givs): Likewise.
(loop_optimize): Allocate loop_number_loop_cont and
loop_number_cont_dominator. Use compute_luids.
(find_and_verify_loops): Initialize loop_number_loop_cont and
loop_number_cont_dominator.
(strength_reduce): Try to find bivs that can be expressed as givs
of another biv, and to convert biv increments into givs.
Call recombine_givs. Handle derived givs.
(record_biv): New argument location. All callers changed.
(record_giv): Initialize derived and last_use fields.
(basic_induction_var): New argument location. All callers changed.
(combine_givs): Don't combine a DEST_REG giv with a DEST_ADDR giv.
Increment combined_with instead of setting to 1.
* unroll.c (derived_regs): New static variable.
(unroll_loop): Initialize it.
Allocate local_regno according to max_reg_num.
(copy_loop_body): Cope with derived givs.
(find_splittable_givs): Check for Givs made from biv increments.
Set derived_regs for givs.
* Makefile.in (stmt.o, loop.o, unroll.o): Depend on loop.h .
From-SVN: r24889
1999-01-27 16:45:50 +01:00
|
|
|
|
src_regno = REGNO (giv_src_reg);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY)
|
|
|
|
|
{
|
|
|
|
|
/* Completely unrolling the loop. Set the induction
|
|
|
|
|
variable to a known constant value. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The value in splittable_regs may be an invariant
|
|
|
|
|
value, so we must use plus_constant here. */
|
|
|
|
|
splittable_regs[regno]
|
rtl.h (insn_first_p): Declare.
* rtl.h (insn_first_p): Declare.
* rtlanal.c (insn_first_p): New function.
* loop.h (varray.h): Include.
(struct induction): Change combined_with to unsigned.
New members derived, ix and last_use.
(reg_iv_type, reg_iv_info): Now varray_type. All references changed.
(REG_IV_TYPE, REG_IV_INFO): Define.
(first_increment_giv, last_increment_giv): Declare.
* loop.c (loop_number_loop_cont): New static variable.
(loop_number_cont_dominator): Likewise.
(reg_iv_type, reg_iv_info): Now varray_type.
(first_increment_giv, last_increment_giv): New variables.
(compute_luids, verify_dominator, find_life_end): New functions.
(cmp_recombine_givs_stats, recombine_givs): Likewise.
(loop_optimize): Allocate loop_number_loop_cont and
loop_number_cont_dominator. Use compute_luids.
(find_and_verify_loops): Initialize loop_number_loop_cont and
loop_number_cont_dominator.
(strength_reduce): Try to find bivs that can be expressed as givs
of another biv, and to convert biv increments into givs.
Call recombine_givs. Handle derived givs.
(record_biv): New argument location. All callers changed.
(record_giv): Initialize derived and last_use fields.
(basic_induction_var): New argument location. All callers changed.
(combine_givs): Don't combine a DEST_REG giv with a DEST_ADDR giv.
Increment combined_with instead of setting to 1.
* unroll.c (derived_regs): New static variable.
(unroll_loop): Initialize it.
Allocate local_regno according to max_reg_num.
(copy_loop_body): Cope with derived givs.
(find_splittable_givs): Check for Givs made from biv increments.
Set derived_regs for givs.
* Makefile.in (stmt.o, loop.o, unroll.o): Depend on loop.h .
From-SVN: r24889
1999-01-27 16:45:50 +01:00
|
|
|
|
= plus_constant (splittable_regs[src_regno],
|
|
|
|
|
INTVAL (giv_inc));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (splittable_regs[regno]) == PLUS)
|
|
|
|
|
{
|
|
|
|
|
giv_src_reg = XEXP (splittable_regs[regno], 0);
|
|
|
|
|
giv_inc = XEXP (splittable_regs[regno], 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* The splittable_regs value must be a REG or a
|
|
|
|
|
CONST_INT, so put the entire value in the giv_src_reg
|
|
|
|
|
variable. */
|
|
|
|
|
giv_src_reg = splittable_regs[regno];
|
|
|
|
|
giv_inc = const0_rtx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Partially unrolling loop. Create a new pseudo
|
|
|
|
|
register for the iteration variable, and set it to
|
|
|
|
|
be a constant plus the original register. Except
|
|
|
|
|
on the last iteration, when the result has to
|
|
|
|
|
go back into the original iteration var register. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Handle bivs which must be mapped to a new register
|
|
|
|
|
when split. This happens for bivs which need their
|
|
|
|
|
final value set before loop entry. The new register
|
|
|
|
|
for the biv was stored in the biv's first struct
|
|
|
|
|
induction entry by find_splittable_regs. */
|
|
|
|
|
|
2001-01-01 02:04:01 +01:00
|
|
|
|
if (regno < ivs->n_regs
|
2000-09-11 23:48:46 +02:00
|
|
|
|
&& REG_IV_TYPE (ivs, regno) == BASIC_INDUCT)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
2001-01-01 01:37:09 +01:00
|
|
|
|
giv_src_reg = REG_IV_CLASS (ivs, regno)->biv->src_reg;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
giv_dest_reg = giv_src_reg;
|
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#if 0
|
|
|
|
|
/* If non-reduced/final-value givs were split, then
|
|
|
|
|
this would have to remap those givs also. See
|
|
|
|
|
find_splittable_regs. */
|
|
|
|
|
#endif
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
splittable_regs[regno]
|
2000-07-18 02:16:59 +02:00
|
|
|
|
= simplify_gen_binary (PLUS, GET_MODE (giv_src_reg),
|
|
|
|
|
giv_inc,
|
|
|
|
|
splittable_regs[src_regno]);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
giv_inc = splittable_regs[regno];
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Now split the induction variable by changing the dest
|
|
|
|
|
of this insn to a new register, and setting its
|
|
|
|
|
reg_map entry to point to this new register.
|
|
|
|
|
|
|
|
|
|
If this is the last iteration, and this is the last insn
|
|
|
|
|
that will update the iv, then reuse the original dest,
|
|
|
|
|
to ensure that the iv will have the proper value when
|
|
|
|
|
the loop exits or repeats.
|
|
|
|
|
|
|
|
|
|
Using splittable_regs_updates here like this is safe,
|
|
|
|
|
because it can only be greater than one if all
|
|
|
|
|
instructions modifying the iv are always executed in
|
|
|
|
|
order. */
|
|
|
|
|
|
|
|
|
|
if (! last_iteration
|
|
|
|
|
|| (splittable_regs_updates[regno]-- != 1))
|
|
|
|
|
{
|
|
|
|
|
tem = gen_reg_rtx (GET_MODE (giv_src_reg));
|
|
|
|
|
giv_dest_reg = tem;
|
|
|
|
|
map->reg_map[regno] = tem;
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem),
|
|
|
|
|
giv_inc == const0_rtx
|
|
|
|
|
? giv_src_reg
|
|
|
|
|
: gen_rtx_PLUS (GET_MODE (giv_src_reg),
|
|
|
|
|
giv_src_reg, giv_inc),
|
|
|
|
|
1);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
map->reg_map[regno] = giv_src_reg;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The constant being added could be too large for an add
|
|
|
|
|
immediate, so can't directly emit an insn here. */
|
|
|
|
|
emit_unrolled_add (giv_dest_reg, giv_src_reg, giv_inc);
|
|
|
|
|
copy = get_last_insn ();
|
|
|
|
|
pattern = PATTERN (copy);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
pattern = copy_rtx_and_substitute (pattern, map, 0);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
copy = emit_insn (pattern);
|
|
|
|
|
}
|
1993-05-17 01:14:24 +02:00
|
|
|
|
REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
|
loop.c (emit_prefetch_instructions): Properly place the address computation.
* loop.c (emit_prefetch_instructions): Properly place the address computation.
* basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill.
(set_block_for_insn): Turn into macro.
* cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn.
* cfglayout.c (insn_scopes): Kill.
(scope_to_insns_initialize): Do not use insn_scopes.
(scope_to_insns_finalize): Likewise.
(duplicate_insn_chain): Likewise.
(cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes.
* cfgrtl.c (basic_block_for_insn): Kill.
(delete_insn_and_edges, delete_insn_chain_and_edges): Simplify.
(create_basic_block_structure): Use reorder_insns.
(compute_bb_for_insn): Do not use basic_block_for_insn.
(merge_blocks_nomove): Likewise.
(update_bb_for_insn): Likewise.
(verify_flow_info): Likewise.
(set_block_for_insn): Kill.
* combine.c (try_combine): Update gen_rtx_INSN call.
* emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call.
(mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear
scopes and BBs.
(add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify.
(emit_note_before, emit_note_after, emit_line_note_after, emit_note):
Clear BB.
(emit_insns_after): Simplify.
(emit_copy_of_insn_after): Copy scope.
* final.c (final_start_function): Lower scopes.
* flow.c (check_function_return_warnings): Do not rely on deleted insn.
* integrate.c (copy_insn_list): Cope scopes.
* jump.c (duplicate_loop_exit_test): LIkewise; simplify.
* loop.c (loop_optimize): Do not care block notes.
* print-rtl.c (print_rtx): Print BB.
* recog.c (apply_change_group): Simplify.
* rtl.c (copy_rtx): Handle 'B'.
* rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields.
* rtl.h (Field accessors): Update indexes.
* sched-ebb.c (schedule_ebbs): Do not lower notes.
* sched-rgn.c (schedule_insns): Likewise.
* toplev.c (rest_of_compilation): Lower notes.
* unroll.c (unroll_loop): Do not care scoping notes.
(copy_loop_body): Copy scopes.
From-SVN: r54188
2002-06-02 23:09:54 +02:00
|
|
|
|
INSN_SCOPE (copy) = INSN_SCOPE (insn);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
2002-10-05 06:06:17 +02:00
|
|
|
|
/* If there is a REG_EQUAL note present whose value
|
|
|
|
|
is not loop invariant, then delete it, since it
|
|
|
|
|
may cause problems with later optimization passes. */
|
|
|
|
|
if ((tem = find_reg_note (copy, REG_EQUAL, NULL_RTX))
|
|
|
|
|
&& !loop_invariant_p (loop, XEXP (tem, 0)))
|
|
|
|
|
remove_note (copy, tem);
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
/* If this insn is setting CC0, it may need to look at
|
|
|
|
|
the insn that uses CC0 to see what type of insn it is.
|
|
|
|
|
In that case, the call to recog via validate_change will
|
|
|
|
|
fail. So don't substitute constants here. Instead,
|
|
|
|
|
do it when we emit the following insn.
|
|
|
|
|
|
|
|
|
|
For example, see the pyr.md file. That machine has signed and
|
|
|
|
|
unsigned compares. The compare patterns must check the
|
|
|
|
|
following branch insn to see which what kind of compare to
|
|
|
|
|
emit.
|
|
|
|
|
|
|
|
|
|
If the previous insn set CC0, substitute constants on it as
|
|
|
|
|
well. */
|
1995-06-01 00:06:21 +02:00
|
|
|
|
if (sets_cc0_p (PATTERN (copy)) != 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
cc0_insn = copy;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (cc0_insn)
|
|
|
|
|
try_constants (cc0_insn, map);
|
|
|
|
|
cc0_insn = 0;
|
|
|
|
|
try_constants (copy, map);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
try_constants (copy, map);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Make split induction variable constants `permanent' since we
|
|
|
|
|
know there are no backward branches across iteration variable
|
|
|
|
|
settings which would invalidate this. */
|
1999-10-24 22:25:28 +02:00
|
|
|
|
if (dest_reg_was_split)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1999-10-24 22:31:26 +02:00
|
|
|
|
int regno = REGNO (SET_DEST (set));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1999-08-25 15:37:46 +02:00
|
|
|
|
if ((size_t) regno < VARRAY_SIZE (map->const_equiv_varray)
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
&& (VARRAY_CONST_EQUIV (map->const_equiv_varray, regno).age
|
|
|
|
|
== map->const_age))
|
|
|
|
|
VARRAY_CONST_EQUIV (map->const_equiv_varray, regno).age = -1;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
case JUMP_INSN:
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
|
1992-12-31 21:47:49 +01:00
|
|
|
|
copy = emit_jump_insn (pattern);
|
1993-05-17 01:14:24 +02:00
|
|
|
|
REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
|
loop.c (emit_prefetch_instructions): Properly place the address computation.
* loop.c (emit_prefetch_instructions): Properly place the address computation.
* basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill.
(set_block_for_insn): Turn into macro.
* cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn.
* cfglayout.c (insn_scopes): Kill.
(scope_to_insns_initialize): Do not use insn_scopes.
(scope_to_insns_finalize): Likewise.
(duplicate_insn_chain): Likewise.
(cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes.
* cfgrtl.c (basic_block_for_insn): Kill.
(delete_insn_and_edges, delete_insn_chain_and_edges): Simplify.
(create_basic_block_structure): Use reorder_insns.
(compute_bb_for_insn): Do not use basic_block_for_insn.
(merge_blocks_nomove): Likewise.
(update_bb_for_insn): Likewise.
(verify_flow_info): Likewise.
(set_block_for_insn): Kill.
* combine.c (try_combine): Update gen_rtx_INSN call.
* emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call.
(mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear
scopes and BBs.
(add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify.
(emit_note_before, emit_note_after, emit_line_note_after, emit_note):
Clear BB.
(emit_insns_after): Simplify.
(emit_copy_of_insn_after): Copy scope.
* final.c (final_start_function): Lower scopes.
* flow.c (check_function_return_warnings): Do not rely on deleted insn.
* integrate.c (copy_insn_list): Cope scopes.
* jump.c (duplicate_loop_exit_test): LIkewise; simplify.
* loop.c (loop_optimize): Do not care block notes.
* print-rtl.c (print_rtx): Print BB.
* recog.c (apply_change_group): Simplify.
* rtl.c (copy_rtx): Handle 'B'.
* rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields.
* rtl.h (Field accessors): Update indexes.
* sched-ebb.c (schedule_ebbs): Do not lower notes.
* sched-rgn.c (schedule_insns): Likewise.
* toplev.c (rest_of_compilation): Lower notes.
* unroll.c (unroll_loop): Do not care scoping notes.
(copy_loop_body): Copy scopes.
From-SVN: r54188
2002-06-02 23:09:54 +02:00
|
|
|
|
INSN_SCOPE (copy) = INSN_SCOPE (insn);
|
1992-12-31 21:47:49 +01:00
|
|
|
|
|
2002-01-07 12:00:39 +01:00
|
|
|
|
if (JUMP_LABEL (insn))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
Jan Hubicka <jh@suse.cz>
* jump.c (invert_exp_1): Remove first argument, use pc_set
to get the expression.
(redirect_exp): Make static; redirect only the pc_set expression,
remove first argument.
(invert_exp): Remove first argument, make static.
(jump_optimize): Use any_condjump_p, any_uncondjump_p and
any_onlyjump at most places where we originaly did condjump_p
and simplejump_p.
(jump_back_p, follow_jumps, thread_jumps): Likewise.
(delete_barrier_succesors): Use pc_set.
(invert_jump_1, invert_jump, redirect_jump_1, redirect_jump): Update
calls of invert_exp and redirect_exp.
* rtl.h (redirect_exp, invert_exp): Remove.
* unroll.c (copy_loop_body): Use invert_jump and redirect_jump.
From-SVN: r34171
2000-05-25 18:41:30 +02:00
|
|
|
|
JUMP_LABEL (copy) = get_label_from_map (map,
|
|
|
|
|
CODE_LABEL_NUMBER
|
|
|
|
|
(JUMP_LABEL (insn)));
|
2000-09-19 09:35:55 +02:00
|
|
|
|
LABEL_NUSES (JUMP_LABEL (copy))++;
|
2002-01-07 12:00:39 +01:00
|
|
|
|
}
|
|
|
|
|
if (JUMP_LABEL (insn) == start_label && insn == copy_end
|
|
|
|
|
&& ! last_iteration)
|
|
|
|
|
{
|
2000-09-19 09:35:55 +02:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* This is a branch to the beginning of the loop; this is the
|
|
|
|
|
last insn being copied; and this is not the last iteration.
|
|
|
|
|
In this case, we want to change the original fall through
|
|
|
|
|
case to be a branch past the end of the loop, and the
|
|
|
|
|
original jump label case to fall_through. */
|
1992-08-15 00:41:07 +02:00
|
|
|
|
|
Jan Hubicka <jh@suse.cz>
* jump.c (invert_exp_1): Remove first argument, use pc_set
to get the expression.
(redirect_exp): Make static; redirect only the pc_set expression,
remove first argument.
(invert_exp): Remove first argument, make static.
(jump_optimize): Use any_condjump_p, any_uncondjump_p and
any_onlyjump at most places where we originaly did condjump_p
and simplejump_p.
(jump_back_p, follow_jumps, thread_jumps): Likewise.
(delete_barrier_succesors): Use pc_set.
(invert_jump_1, invert_jump, redirect_jump_1, redirect_jump): Update
calls of invert_exp and redirect_exp.
* rtl.h (redirect_exp, invert_exp): Remove.
* unroll.c (copy_loop_body): Use invert_jump and redirect_jump.
From-SVN: r34171
2000-05-25 18:41:30 +02:00
|
|
|
|
if (!invert_jump (copy, exit_label, 0))
|
1994-10-17 14:25:38 +01:00
|
|
|
|
{
|
|
|
|
|
rtx jmp;
|
|
|
|
|
rtx lab = gen_label_rtx ();
|
1995-05-16 14:39:54 +02:00
|
|
|
|
/* Can't do it by reversing the jump (probably because we
|
|
|
|
|
couldn't reverse the conditions), so emit a new
|
1994-10-17 14:25:38 +01:00
|
|
|
|
jump_insn after COPY, and redirect the jump around
|
|
|
|
|
that. */
|
|
|
|
|
jmp = emit_jump_insn_after (gen_jump (exit_label), copy);
|
2001-11-16 18:08:12 +01:00
|
|
|
|
JUMP_LABEL (jmp) = exit_label;
|
2001-11-21 01:50:56 +01:00
|
|
|
|
LABEL_NUSES (exit_label)++;
|
1994-10-17 14:25:38 +01:00
|
|
|
|
jmp = emit_barrier_after (jmp);
|
|
|
|
|
emit_label_after (lab, jmp);
|
|
|
|
|
LABEL_NUSES (lab) = 0;
|
Jan Hubicka <jh@suse.cz>
* jump.c (invert_exp_1): Remove first argument, use pc_set
to get the expression.
(redirect_exp): Make static; redirect only the pc_set expression,
remove first argument.
(invert_exp): Remove first argument, make static.
(jump_optimize): Use any_condjump_p, any_uncondjump_p and
any_onlyjump at most places where we originaly did condjump_p
and simplejump_p.
(jump_back_p, follow_jumps, thread_jumps): Likewise.
(delete_barrier_succesors): Use pc_set.
(invert_jump_1, invert_jump, redirect_jump_1, redirect_jump): Update
calls of invert_exp and redirect_exp.
* rtl.h (redirect_exp, invert_exp): Remove.
* unroll.c (copy_loop_body): Use invert_jump and redirect_jump.
From-SVN: r34171
2000-05-25 18:41:30 +02:00
|
|
|
|
if (!redirect_jump (copy, lab, 0))
|
2000-09-12 16:43:25 +02:00
|
|
|
|
abort ();
|
1994-10-17 14:25:38 +01:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
if (cc0_insn)
|
|
|
|
|
try_constants (cc0_insn, map);
|
|
|
|
|
cc0_insn = 0;
|
|
|
|
|
#endif
|
|
|
|
|
try_constants (copy, map);
|
|
|
|
|
|
|
|
|
|
/* Set the jump label of COPY correctly to avoid problems with
|
|
|
|
|
later passes of unroll_loop, if INSN had jump label set. */
|
|
|
|
|
if (JUMP_LABEL (insn))
|
|
|
|
|
{
|
1992-09-28 22:18:17 +01:00
|
|
|
|
rtx label = 0;
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Can't use the label_map for every insn, since this may be
|
|
|
|
|
the backward branch, and hence the label was not mapped. */
|
1998-04-04 15:32:39 +02:00
|
|
|
|
if ((set = single_set (copy)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1998-04-04 15:32:39 +02:00
|
|
|
|
tem = SET_SRC (set);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (tem) == LABEL_REF)
|
1992-09-28 22:18:17 +01:00
|
|
|
|
label = XEXP (tem, 0);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else if (GET_CODE (tem) == IF_THEN_ELSE)
|
|
|
|
|
{
|
|
|
|
|
if (XEXP (tem, 1) != pc_rtx)
|
1992-09-28 22:18:17 +01:00
|
|
|
|
label = XEXP (XEXP (tem, 1), 0);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
1992-09-28 22:18:17 +01:00
|
|
|
|
label = XEXP (XEXP (tem, 2), 0);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
1992-09-28 22:18:17 +01:00
|
|
|
|
|
|
|
|
|
if (label && GET_CODE (label) == CODE_LABEL)
|
|
|
|
|
JUMP_LABEL (copy) = label;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* An unrecognizable jump insn, probably the entry jump
|
|
|
|
|
for a switch statement. This label must have been mapped,
|
|
|
|
|
so just use the label_map to get the new jump label. */
|
1994-12-05 20:46:45 +01:00
|
|
|
|
JUMP_LABEL (copy)
|
1999-02-04 23:55:55 +01:00
|
|
|
|
= get_label_from_map (map,
|
|
|
|
|
CODE_LABEL_NUMBER (JUMP_LABEL (insn)));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* If this is a non-local jump, then must increase the label
|
|
|
|
|
use count so that the label will not be deleted when the
|
|
|
|
|
original jump is deleted. */
|
|
|
|
|
LABEL_NUSES (JUMP_LABEL (copy))++;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (PATTERN (copy)) == ADDR_VEC
|
|
|
|
|
|| GET_CODE (PATTERN (copy)) == ADDR_DIFF_VEC)
|
|
|
|
|
{
|
|
|
|
|
rtx pat = PATTERN (copy);
|
|
|
|
|
int diff_vec_p = GET_CODE (pat) == ADDR_DIFF_VEC;
|
|
|
|
|
int len = XVECLEN (pat, diff_vec_p);
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < len; i++)
|
|
|
|
|
LABEL_NUSES (XEXP (XVECEXP (pat, diff_vec_p, i), 0))++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If this used to be a conditional jump insn but whose branch
|
|
|
|
|
direction is now known, we must do something special. */
|
combine.c (try_combine): Use any_condjump_p...
* combine.c (try_combine): Use any_condjump_p, any_uncondjump_p
and pc_set at the place of simplejump_p and condjump_p.
* cse.c (record_jump_equiv): Likewise.
* emit-rtl.c (emit): Likewise.
* explow.c (find_next_ref): Likewise.
* flow.c (tidy_fallthru_edge): Likewise.
(init_propagate_block_info): Likewise.
* gcse.c (delete_null_pointer_checks): Likewise.
* ifcvt.c (cond_exec_get_condition, noce_get_condition,
dead_or_predicable): Likewise.
* integrate.c (copy_insn_list): Likewise.
* loop.c (scan_loop, verify_dominator, find_and_verify_loops,
for_each_insn_in_loop, check_dbra_loop, get_condition,
insert_bct, load_mems): Likewise.
* resource.c (find_dead_or_set_registers): Likewise.
* sibcalls.c (simplejump_p): Likewise.
* unroll.c (copy_loop_body, reg_dead_after_loop): Likewise.
From-SVN: r34175
2000-05-25 23:38:49 +02:00
|
|
|
|
if (any_condjump_p (insn) && onlyjump_p (insn) && map->last_pc_value)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_cc0
|
1999-08-18 19:51:27 +02:00
|
|
|
|
/* If the previous insn set cc0 for us, delete it. */
|
2001-08-15 21:25:43 +02:00
|
|
|
|
if (only_sets_cc0_p (PREV_INSN (copy)))
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_related_insns (PREV_INSN (copy));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* If this is now a no-op, delete it. */
|
|
|
|
|
if (map->last_pc_value == pc_rtx)
|
|
|
|
|
{
|
Makefile.in (cfgrtl.o): Add.
* Makefile.in (cfgrtl.o): Add.
* basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks,
free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges,
free_aux_for_edge): Declare.
* cfg.c
(HAVE_return): Undefine.
* basic-block.h (alloc_block, alloc_aux_for_block, alloc_aux_for_blocks,
free_aux_for_block, alloc_aux_for_edge, alloc_aux_for_edges,
free_aux_for_edge): New global functions.
(first_delete_block): New static variable.
(init_flow): Clear first_delete_block.
(basic_block_for_insn, label_value_list, tail_recursion_label_list,
can_delete_note_p, can_delete_label_p, commit_one_edge_insertion,
try_redirect_by_replacing_jump, last_loop_beg_note,
back_edge_of_syntactic_loop_p, force_nonfallthru_and_redirect,
delete_insn, delete_insn_chain, create_basic_block_structure,
create_basic_block, flow_delete_block, compute_bb_for_insn,
free_bb_for_insn, update_bb_for_insn, set_block_for_insn,
set_block_for_new_insns, split_block, merge_blocks_nomove,
block_label, try_redirect_by_replacing_jump, last_loop_beg_note,
redirect_edge_and_branch, force_nonfallthru_and_redirect,
force_nonfallthru, redirect_edge_and_branch_force, tidy_fallthru_edge,
tidy_fallthru_edges, split_edge, insert_insn_on_edge,
commit_one_edge_insertion, commit_edge_insertions, dump_bb, debug_bb,
debug_bb_n, print_rtl_with_bb, verify_flow_info, purge_dead_edges,
purge_all_dead_edges): Move to ....
* cfgrtl.c: New file; .... Here.
* bb-reorder.c (fixup_reorder_chain): Use alloc_aux_for_block.
(reroder_basic_block): Use alloc_aux_for_blocks.
* predict.c (estimate_bb_frequencies): Likewise; use
alloc_aux_for_edges.
* profile.c (compute_branch_probabilities): Likewise.
(branch_prob): Likewise.
* reg-stack.c (reg_to_stack): Likewise.
* emit-rtl.c (emit_insns_after): Never return NULL.
* basic-block.h (set_block_for_new_insns): Delete.
* cfgrtl.c (set_block_for_new_insns): Delete.
* cfgcleanup.c (try_optimize_cfg): Add fake exit edges for noreturn
calls when crossjumping.
* cfgcleanup.c (try_simplify_condjump): Cleanup invert_jump call.
* unroll.c (copy_loop_body): Use delete_insn.
* final.c (final, final_scan_insn): Use delete_insn/delete_note.
* function.c (fixup_var_refs_insn, fixup_var_refs_1,
keep_stack_depressed): Likewise.
* gcse.c (cprop_cc0_jump): Likewise.
* local-alloc.c (update_equiv_regs): Likewise.
* loop.c (scan_loop, loop_delete_insns): Likewise.
* regmove.c (try_auto_increment, fixup_match_1): Likewise.
* reload1.c (reload, calculate_needs_all_insns, reload_as_needed,
delete_output_reload, delete_address_reloads_1,
reload_cse_delete_noop_set, reload_combine, reload_cse_move2add):
Likewise.
* sibcall.c (replace_call_placeholder): Likewise.
* cse.c (cse_insn): Likewise.
From-SVN: r45807
2001-09-25 17:26:55 +02:00
|
|
|
|
delete_insn (copy);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
copy = 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
/* Otherwise, this is unconditional jump so we must put a
|
|
|
|
|
BARRIER after it. We could do some dead code elimination
|
|
|
|
|
here, but jump.c will do it just as well. */
|
|
|
|
|
emit_barrier ();
|
|
|
|
|
}
|
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
case CALL_INSN:
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
pattern = copy_rtx_and_substitute (PATTERN (insn), map, 0);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
copy = emit_call_insn (pattern);
|
1993-05-17 01:14:24 +02:00
|
|
|
|
REG_NOTES (copy) = initial_reg_note_copy (REG_NOTES (insn), map);
|
loop.c (emit_prefetch_instructions): Properly place the address computation.
* loop.c (emit_prefetch_instructions): Properly place the address computation.
* basic-block.h (basic_block_for_insn, BLOCK_FOR_INSN): Kill.
(set_block_for_insn): Turn into macro.
* cfgbuild.c (find_basic_block): Do not clear basic_block_for_insn.
* cfglayout.c (insn_scopes): Kill.
(scope_to_insns_initialize): Do not use insn_scopes.
(scope_to_insns_finalize): Likewise.
(duplicate_insn_chain): Likewise.
(cfg_layout_initialize, cfg_layout_finalize): Do not turn scopes to notes.
* cfgrtl.c (basic_block_for_insn): Kill.
(delete_insn_and_edges, delete_insn_chain_and_edges): Simplify.
(create_basic_block_structure): Use reorder_insns.
(compute_bb_for_insn): Do not use basic_block_for_insn.
(merge_blocks_nomove): Likewise.
(update_bb_for_insn): Likewise.
(verify_flow_info): Likewise.
(set_block_for_insn): Kill.
* combine.c (try_combine): Update gen_rtx_INSN call.
* emit-rtl.c (gen_label_rtx): Update gen_rtx_CODE_LABEL call.
(mark_insn_raw, make_jump_insn_raw, make_call_insn_raw): Clear
scopes and BBs.
(add_insn_after, add_insn_before, remove_insn, reorder_insns): Simplify.
(emit_note_before, emit_note_after, emit_line_note_after, emit_note):
Clear BB.
(emit_insns_after): Simplify.
(emit_copy_of_insn_after): Copy scope.
* final.c (final_start_function): Lower scopes.
* flow.c (check_function_return_warnings): Do not rely on deleted insn.
* integrate.c (copy_insn_list): Cope scopes.
* jump.c (duplicate_loop_exit_test): LIkewise; simplify.
* loop.c (loop_optimize): Do not care block notes.
* print-rtl.c (print_rtx): Print BB.
* recog.c (apply_change_group): Simplify.
* rtl.c (copy_rtx): Handle 'B'.
* rtl.def (INSN, CALL_INSN, JUMP_INSN, NOTE): Add extra fields.
* rtl.h (Field accessors): Update indexes.
* sched-ebb.c (schedule_ebbs): Do not lower notes.
* sched-rgn.c (schedule_insns): Likewise.
* toplev.c (rest_of_compilation): Lower notes.
* unroll.c (unroll_loop): Do not care scoping notes.
(copy_loop_body): Copy scopes.
From-SVN: r54188
2002-06-02 23:09:54 +02:00
|
|
|
|
INSN_SCOPE (copy) = INSN_SCOPE (insn);
|
2002-03-15 04:06:26 +01:00
|
|
|
|
SIBLING_CALL_P (copy) = SIBLING_CALL_P (insn);
|
2002-12-02 20:29:45 +01:00
|
|
|
|
CONST_OR_PURE_CALL_P (copy) = CONST_OR_PURE_CALL_P (insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1994-06-01 02:17:00 +02:00
|
|
|
|
/* Because the USAGE information potentially contains objects other
|
|
|
|
|
than hard registers, we need to copy it. */
|
1997-05-07 01:05:54 +02:00
|
|
|
|
CALL_INSN_FUNCTION_USAGE (copy)
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
= copy_rtx_and_substitute (CALL_INSN_FUNCTION_USAGE (insn),
|
|
|
|
|
map, 0);
|
1994-06-01 02:17:00 +02:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
if (cc0_insn)
|
|
|
|
|
try_constants (cc0_insn, map);
|
|
|
|
|
cc0_insn = 0;
|
|
|
|
|
#endif
|
|
|
|
|
try_constants (copy, map);
|
|
|
|
|
|
|
|
|
|
/* Be lazy and assume CALL_INSNs clobber all hard registers. */
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
Use varrays for constant-equivalence data:
* varray.h (struct const_equiv_data): New type.
(union varray_data_tag): New element const_equiv.
(VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV): New macros.
(VARRAY_SIZE): New macro, returns number of elements.
* integrate.h: Include varray.h.
(struct inline_remap): Replace const_equiv_map, const_age_map and
const_equiv_map_size with a const_equiv_varray element.
(MAYBE_EXTEND_CONST_EQUIV_VARRAY): New macro; grows varray if needed.
(SET_CONST_EQUIV_DATA): New macro; sets rtx and age fields simultaneously,
growing the varray if needed.
* integrate.c (global_const_equiv_map, global_const_equiv_map_size): Deleted,
replaced by....
(global_const_equiv_varray): New variable.
(expand_inline_function): References changed.
* integrate.h: Update declarations.
* integrate.c (process_reg_parm, expand_inline_function,
copy_rtx_and_substitute, try_constants, subst_constants, mark_stores): Use
varray allocation and accessor macros, new integrate.h macros, and
global_const_equiv_varray. Don't conditionalize non-NULL stores on array size;
instead, expand the array as needed.
* unroll.c (unroll_loop): Likewise.
* unroll.c (unroll_loop): Initialize const_equiv_varray element to zero. After
allocating varray, always exit through bottom of function, where it can be
deallocated if needed. Don't explicitly reallocate const_equiv_map storage;
instead, just ensure the varray has been initialized, and update the global
reference.
From-SVN: r24956
1999-02-01 13:50:53 +01:00
|
|
|
|
VARRAY_CONST_EQUIV (map->const_equiv_varray, i).rtx = 0;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
case CODE_LABEL:
|
|
|
|
|
/* If this is the loop start label, then we don't need to emit a
|
|
|
|
|
copy of this label since no one will use it. */
|
|
|
|
|
|
|
|
|
|
if (insn != start_label)
|
|
|
|
|
{
|
1997-12-18 23:42:41 +01:00
|
|
|
|
copy = emit_label (get_label_from_map (map,
|
|
|
|
|
CODE_LABEL_NUMBER (insn)));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
map->const_age++;
|
|
|
|
|
}
|
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
case BARRIER:
|
|
|
|
|
copy = emit_barrier ();
|
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
case NOTE:
|
1999-03-02 09:48:09 +01:00
|
|
|
|
/* VTOP and CONT notes are valid only before the loop exit test.
|
|
|
|
|
If placed anywhere else, loop may generate bad code. */
|
1999-02-26 00:45:42 +01:00
|
|
|
|
/* BASIC_BLOCK notes exist to stabilize basic block structures with
|
2000-09-12 16:43:25 +02:00
|
|
|
|
the associated rtl. We do not want to share the structure in
|
1999-02-26 00:45:42 +01:00
|
|
|
|
this new block. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-08-11 21:42:35 +02:00
|
|
|
|
if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
|
2000-05-12 18:26:15 +02:00
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED_LABEL
|
1999-02-26 00:45:42 +01:00
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
|
1999-03-02 09:48:09 +01:00
|
|
|
|
&& ((NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
|
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
|
1992-08-11 21:42:35 +02:00
|
|
|
|
|| (last_iteration && unroll_type != UNROLL_COMPLETELY)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
copy = emit_note (NOTE_SOURCE_FILE (insn),
|
|
|
|
|
NOTE_LINE_NUMBER (insn));
|
|
|
|
|
else
|
|
|
|
|
copy = 0;
|
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
map->insn_map[INSN_UID (insn)] = copy;
|
|
|
|
|
}
|
|
|
|
|
while (insn != copy_end);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1993-05-17 01:14:24 +02:00
|
|
|
|
/* Now finish coping the REG_NOTES. */
|
1993-05-12 20:47:43 +02:00
|
|
|
|
insn = copy_start;
|
|
|
|
|
do
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if ((GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
|
|
|
|
|
|| GET_CODE (insn) == CALL_INSN)
|
|
|
|
|
&& map->insn_map[INSN_UID (insn)])
|
2001-06-12 06:42:46 +02:00
|
|
|
|
final_reg_note_copy (®_NOTES (map->insn_map[INSN_UID (insn)]), map);
|
1993-05-12 20:47:43 +02:00
|
|
|
|
}
|
|
|
|
|
while (insn != copy_end);
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* There may be notes between copy_notes_from and loop_end. Emit a copy of
|
|
|
|
|
each of these notes here, since there may be some important ones, such as
|
|
|
|
|
NOTE_INSN_BLOCK_END notes, in this group. We don't do this on the last
|
|
|
|
|
iteration, because the original notes won't be deleted.
|
|
|
|
|
|
|
|
|
|
We can't use insert_before here, because when from preconditioning,
|
|
|
|
|
insert_before points before the loop. We can't use copy_end, because
|
|
|
|
|
there may be insns already inserted after it (which we don't want to
|
|
|
|
|
copy) when not from preconditioning code. */
|
|
|
|
|
|
|
|
|
|
if (! last_iteration)
|
|
|
|
|
{
|
|
|
|
|
for (insn = copy_notes_from; insn != loop_end; insn = NEXT_INSN (insn))
|
|
|
|
|
{
|
1999-05-05 17:47:48 +02:00
|
|
|
|
/* VTOP notes are valid only before the loop exit test.
|
|
|
|
|
If placed anywhere else, loop may generate bad code.
|
2002-07-30 19:37:58 +02:00
|
|
|
|
Although COPY_NOTES_FROM will be at most one or two (for cc0)
|
|
|
|
|
instructions before the last insn in the loop, COPY_NOTES_FROM
|
|
|
|
|
can be a NOTE_INSN_LOOP_CONT note if there is no VTOP note,
|
|
|
|
|
as in a do .. while loop. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (insn) == NOTE
|
1999-02-26 00:45:42 +01:00
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_DELETED
|
1999-05-05 17:47:48 +02:00
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK
|
2002-07-30 19:37:58 +02:00
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_VTOP
|
|
|
|
|
&& NOTE_LINE_NUMBER (insn) != NOTE_INSN_LOOP_CONT)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
emit_note (NOTE_SOURCE_FILE (insn), NOTE_LINE_NUMBER (insn));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (final_label && LABEL_NUSES (final_label) > 0)
|
|
|
|
|
emit_label (final_label);
|
|
|
|
|
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
tem = get_insns ();
|
1992-02-08 04:27:38 +01:00
|
|
|
|
end_sequence ();
|
2001-01-25 10:28:55 +01:00
|
|
|
|
loop_insn_emit_before (loop, 0, insert_before, tem);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit an insn, using the expand_binop to ensure that a valid insn is
|
|
|
|
|
emitted. This will correctly handle the case where the increment value
|
|
|
|
|
won't fit in the immediate field of a PLUS insns. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
emit_unrolled_add (dest_reg, src_reg, increment)
|
|
|
|
|
rtx dest_reg, src_reg, increment;
|
|
|
|
|
{
|
|
|
|
|
rtx result;
|
|
|
|
|
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
result = expand_simple_binop (GET_MODE (dest_reg), PLUS, src_reg, increment,
|
|
|
|
|
dest_reg, 0, OPTAB_LIB_WIDEN);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (dest_reg != result)
|
|
|
|
|
emit_move_insn (dest_reg, result);
|
|
|
|
|
}
|
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
/* Searches the insns between INSN and LOOP->END. Returns 1 if there
|
1992-02-08 04:27:38 +01:00
|
|
|
|
is a backward branch in that range that branches to somewhere between
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
LOOP->START and INSN. Returns 0 otherwise. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
|
/* ??? This is quadratic algorithm. Could be rewritten to be linear.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
In practice, this is not a problem, because this function is seldom called,
|
|
|
|
|
and uses a negligible amount of CPU time on average. */
|
|
|
|
|
|
1995-05-13 16:57:49 +02:00
|
|
|
|
int
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
back_branch_in_range_p (loop, insn)
|
|
|
|
|
const struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx p, q, target_insn;
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
rtx loop_start = loop->start;
|
|
|
|
|
rtx loop_end = loop->end;
|
|
|
|
|
rtx orig_loop_end = loop->end;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Stop before we get to the backward branch at the end of the loop. */
|
|
|
|
|
loop_end = prev_nonnote_insn (loop_end);
|
|
|
|
|
if (GET_CODE (loop_end) == BARRIER)
|
|
|
|
|
loop_end = PREV_INSN (loop_end);
|
|
|
|
|
|
|
|
|
|
/* Check in case insn has been deleted, search forward for first non
|
|
|
|
|
deleted insn following it. */
|
|
|
|
|
while (INSN_DELETED_P (insn))
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
|
1997-12-07 01:31:01 +01:00
|
|
|
|
/* Check for the case where insn is the last insn in the loop. Deal
|
|
|
|
|
with the case where INSN was a deleted loop test insn, in which case
|
|
|
|
|
it will now be the NOTE_LOOP_END. */
|
|
|
|
|
if (insn == loop_end || insn == orig_loop_end)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
for (p = NEXT_INSN (insn); p != loop_end; p = NEXT_INSN (p))
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (p) == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
target_insn = JUMP_LABEL (p);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Search from loop_start to insn, to see if one of them is
|
|
|
|
|
the target_insn. We can't use INSN_LUID comparisons here,
|
|
|
|
|
since insn may not have an LUID entry. */
|
|
|
|
|
for (q = loop_start; q != insn; q = NEXT_INSN (q))
|
|
|
|
|
if (q == target_insn)
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to generate the simplest rtx for the expression
|
|
|
|
|
(PLUS (MULT mult1 mult2) add1). This is used to calculate the initial
|
|
|
|
|
value of giv's. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
fold_rtx_mult_add (mult1, mult2, add1, mode)
|
|
|
|
|
rtx mult1, mult2, add1;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
rtx temp, mult_res;
|
|
|
|
|
rtx result;
|
|
|
|
|
|
|
|
|
|
/* The modes must all be the same. This should always be true. For now,
|
|
|
|
|
check to make sure. */
|
|
|
|
|
if ((GET_MODE (mult1) != mode && GET_MODE (mult1) != VOIDmode)
|
|
|
|
|
|| (GET_MODE (mult2) != mode && GET_MODE (mult2) != VOIDmode)
|
|
|
|
|
|| (GET_MODE (add1) != mode && GET_MODE (add1) != VOIDmode))
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
/* Ensure that if at least one of mult1/mult2 are constant, then mult2
|
|
|
|
|
will be a constant. */
|
|
|
|
|
if (GET_CODE (mult1) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
temp = mult2;
|
|
|
|
|
mult2 = mult1;
|
|
|
|
|
mult1 = temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mult_res = simplify_binary_operation (MULT, mode, mult1, mult2);
|
|
|
|
|
if (! mult_res)
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
mult_res = gen_rtx_MULT (mode, mult1, mult2);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Again, put the constant second. */
|
|
|
|
|
if (GET_CODE (add1) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
temp = add1;
|
|
|
|
|
add1 = mult_res;
|
|
|
|
|
mult_res = temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = simplify_binary_operation (PLUS, mode, add1, mult_res);
|
|
|
|
|
if (! result)
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
result = gen_rtx_PLUS (mode, add1, mult_res);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Searches the list of induction struct's for the biv BL, to try to calculate
|
|
|
|
|
the total increment value for one iteration of the loop as a constant.
|
|
|
|
|
|
|
|
|
|
Returns the increment value as an rtx, simplified as much as possible,
|
|
|
|
|
if it can be calculated. Otherwise, returns 0. */
|
|
|
|
|
|
1999-02-04 23:55:55 +01:00
|
|
|
|
rtx
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
biv_total_increment (bl)
|
2001-01-12 05:09:43 +01:00
|
|
|
|
const struct iv_class *bl;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
struct induction *v;
|
|
|
|
|
rtx result;
|
|
|
|
|
|
|
|
|
|
/* For increment, must check every instruction that sets it. Each
|
|
|
|
|
instruction must be executed only once each time through the loop.
|
1998-05-06 23:09:07 +02:00
|
|
|
|
To verify this, we check that the insn is always executed, and that
|
1992-02-08 04:27:38 +01:00
|
|
|
|
there are no backward branches after the insn that branch to before it.
|
|
|
|
|
Also, the insn must have a mult_val of one (to make sure it really is
|
|
|
|
|
an increment). */
|
|
|
|
|
|
|
|
|
|
result = const0_rtx;
|
|
|
|
|
for (v = bl->biv; v; v = v->next_iv)
|
|
|
|
|
{
|
|
|
|
|
if (v->always_computable && v->mult_val == const1_rtx
|
2002-08-21 06:33:48 +02:00
|
|
|
|
&& ! v->maybe_multiple
|
|
|
|
|
&& SCALAR_INT_MODE_P (v->mode))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
result = fold_rtx_mult_add (result, const1_rtx, v->add_val, v->mode);
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For each biv and giv, determine whether it can be safely split into
|
|
|
|
|
a different variable for each unrolled copy of the loop body. If it
|
|
|
|
|
is safe to split, then indicate that by saving some useful info
|
|
|
|
|
in the splittable_regs array.
|
|
|
|
|
|
|
|
|
|
If the loop is being completely unrolled, then splittable_regs will hold
|
|
|
|
|
the current value of the induction variable while the loop is unrolled.
|
|
|
|
|
It must be set to the initial value of the induction variable here.
|
|
|
|
|
Otherwise, splittable_regs will hold the difference between the current
|
|
|
|
|
value of the induction variable and the value the induction variable had
|
1993-10-11 22:02:37 +01:00
|
|
|
|
at the top of the loop. It must be set to the value 0 here.
|
|
|
|
|
|
|
|
|
|
Returns the total number of instructions that set registers that are
|
|
|
|
|
splittable. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* ?? If the loop is only unrolled twice, then most of the restrictions to
|
|
|
|
|
constant values are unnecessary, since we can easily calculate increment
|
|
|
|
|
values in this case even if nothing is constant. The increment value
|
|
|
|
|
should not involve a multiply however. */
|
|
|
|
|
|
|
|
|
|
/* ?? Even if the biv/giv increment values aren't constant, it may still
|
|
|
|
|
be beneficial to split the variable if the loop is only unrolled a few
|
|
|
|
|
times, since multiplies by small integers (1,2,3,4) are very cheap. */
|
|
|
|
|
|
|
|
|
|
static int
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
find_splittable_regs (loop, unroll_type, unroll_number)
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
const struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
enum unroll_types unroll_type;
|
|
|
|
|
int unroll_number;
|
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
struct iv_class *bl;
|
1992-09-19 21:50:23 +02:00
|
|
|
|
struct induction *v;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx increment, tem;
|
|
|
|
|
rtx biv_final_value;
|
|
|
|
|
int biv_splittable;
|
|
|
|
|
int result = 0;
|
|
|
|
|
|
2001-01-01 01:49:30 +01:00
|
|
|
|
for (bl = ivs->list; bl; bl = bl->next)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
/* Biv_total_increment must return a constant value,
|
|
|
|
|
otherwise we can not calculate the split values. */
|
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
increment = biv_total_increment (bl);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (! increment || GET_CODE (increment) != CONST_INT)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* The loop must be unrolled completely, or else have a known number
|
|
|
|
|
of iterations and only one exit, or else the biv must be dead
|
|
|
|
|
outside the loop, or else the final value must be known. Otherwise,
|
|
|
|
|
it is unsafe to split the biv since it may not have the proper
|
|
|
|
|
value on loop exit. */
|
|
|
|
|
|
2002-09-27 14:48:07 +02:00
|
|
|
|
/* loop_number_exit_count is nonzero if the loop has an exit other than
|
1992-02-08 04:27:38 +01:00
|
|
|
|
a fall through at the end. */
|
|
|
|
|
|
|
|
|
|
biv_splittable = 1;
|
|
|
|
|
biv_final_value = 0;
|
|
|
|
|
if (unroll_type != UNROLL_COMPLETELY
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
&& (loop->exit_count || unroll_type == UNROLL_NAIVE)
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
&& (REGNO_LAST_LUID (bl->regno) >= INSN_LUID (loop->end)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|| ! bl->init_insn
|
|
|
|
|
|| INSN_UID (bl->init_insn) >= max_uid_for_loop
|
2001-01-01 01:14:30 +01:00
|
|
|
|
|| (REGNO_FIRST_LUID (bl->regno)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
< INSN_LUID (bl->init_insn))
|
|
|
|
|
|| reg_mentioned_p (bl->biv->dest_reg, SET_SRC (bl->init_set)))
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
&& ! (biv_final_value = final_biv_value (loop, bl)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
biv_splittable = 0;
|
|
|
|
|
|
1992-09-19 21:50:23 +02:00
|
|
|
|
/* If any of the insns setting the BIV don't do so with a simple
|
|
|
|
|
PLUS, we don't know how to split it. */
|
|
|
|
|
for (v = bl->biv; biv_splittable && v; v = v->next_iv)
|
|
|
|
|
if ((tem = single_set (v->insn)) == 0
|
|
|
|
|
|| GET_CODE (SET_DEST (tem)) != REG
|
|
|
|
|
|| REGNO (SET_DEST (tem)) != bl->regno
|
|
|
|
|
|| GET_CODE (SET_SRC (tem)) != PLUS)
|
|
|
|
|
biv_splittable = 0;
|
|
|
|
|
|
2002-09-27 14:48:07 +02:00
|
|
|
|
/* If final value is nonzero, then must emit an instruction which sets
|
1992-02-08 04:27:38 +01:00
|
|
|
|
the value of the biv to the proper value. This is done after
|
|
|
|
|
handling all of the givs, since some of them may need to use the
|
|
|
|
|
biv's value in their initialization code. */
|
|
|
|
|
|
|
|
|
|
/* This biv is splittable. If completely unrolling the loop, save
|
|
|
|
|
the biv's initial value. Otherwise, save the constant zero. */
|
|
|
|
|
|
|
|
|
|
if (biv_splittable == 1)
|
|
|
|
|
{
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY)
|
|
|
|
|
{
|
|
|
|
|
/* If the initial value of the biv is itself (i.e. it is too
|
|
|
|
|
complicated for strength_reduce to compute), or is a hard
|
1995-06-27 01:17:37 +02:00
|
|
|
|
register, or it isn't invariant, then we must create a new
|
|
|
|
|
pseudo reg to hold the initial value of the biv. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (bl->initial_value) == REG
|
|
|
|
|
&& (REGNO (bl->initial_value) == bl->regno
|
1995-06-27 01:17:37 +02:00
|
|
|
|
|| REGNO (bl->initial_value) < FIRST_PSEUDO_REGISTER
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
|| ! loop_invariant_p (loop, bl->initial_value)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
rtx tem = gen_reg_rtx (bl->biv->mode);
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem), bl->biv->add_val, 0);
|
2002-06-01 00:15:42 +02:00
|
|
|
|
loop_insn_hoist (loop,
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
gen_move_insn (tem, bl->biv->src_reg));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Biv %d initial value remapped to %d.\n",
|
1992-02-08 04:27:38 +01:00
|
|
|
|
bl->regno, REGNO (tem));
|
|
|
|
|
|
|
|
|
|
splittable_regs[bl->regno] = tem;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
splittable_regs[bl->regno] = bl->initial_value;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
splittable_regs[bl->regno] = const0_rtx;
|
|
|
|
|
|
|
|
|
|
/* Save the number of instructions that modify the biv, so that
|
|
|
|
|
we can treat the last one specially. */
|
|
|
|
|
|
|
|
|
|
splittable_regs_updates[bl->regno] = bl->biv_count;
|
1993-10-11 22:02:37 +01:00
|
|
|
|
result += bl->biv_count;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Biv %d safe to split.\n", bl->regno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check every giv that depends on this biv to see whether it is
|
|
|
|
|
splittable also. Even if the biv isn't splittable, givs which
|
|
|
|
|
depend on it may be splittable if the biv is live outside the
|
|
|
|
|
loop, and the givs aren't. */
|
|
|
|
|
|
2000-09-12 16:43:25 +02:00
|
|
|
|
result += find_splittable_givs (loop, bl, unroll_type, increment,
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
unroll_number);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2002-09-27 14:48:07 +02:00
|
|
|
|
/* If final value is nonzero, then must emit an instruction which sets
|
1992-02-08 04:27:38 +01:00
|
|
|
|
the value of the biv to the proper value. This is done after
|
|
|
|
|
handling all of the givs, since some of them may need to use the
|
|
|
|
|
biv's value in their initialization code. */
|
|
|
|
|
if (biv_final_value)
|
|
|
|
|
{
|
|
|
|
|
/* If the loop has multiple exits, emit the insns before the
|
|
|
|
|
loop to ensure that it will always be executed no matter
|
|
|
|
|
how the loop exits. Otherwise emit the insn after the loop,
|
|
|
|
|
since this is slightly more efficient. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (! loop->exit_count)
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_insn_sink (loop, gen_move_insn (bl->biv->src_reg,
|
|
|
|
|
biv_final_value));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Create a new register to hold the value of the biv, and then
|
|
|
|
|
set the biv to its final value before the loop start. The biv
|
|
|
|
|
is set to its final value before loop start to ensure that
|
|
|
|
|
this insn will always be executed, no matter how the loop
|
|
|
|
|
exits. */
|
|
|
|
|
rtx tem = gen_reg_rtx (bl->biv->mode);
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem), bl->biv->add_val, 0);
|
* Integrate alias analysis changes from jfc@mit.edu
* Makefile.in (OBJS): Add alias.o
(alias.o): Add dependencies.
* alias.c: New file.
* sched.c: Remove alias analysis code. It lives in alias.c now.
(reg_last_uses_size): Declare.
(sched_analyze_2): Add new arguments to true_dependence.
(sched_analyze_insn): Use reg_last_uses_size instead of max_reg.
(schedule_block): Initialize reg_last_uses_size.
(schedule_insns): Always call init_alias_analysis.
* calls.c (expand_call): Note calls to malloc, calloc, and realloc;
mark return value from such functions as a pointer and keep track of
them for alias analysis. If a return value from a function is a
pointer, mark it as such.
* combine.c (distribute_notes): Handle REG_NOALIAS.
* cse.c (struct write_data): Delete. No longer needed.
(invalidate): Don't call set_nonvarying_address_components anymore.
Use true_dependence to decide if an entry should be removed from
the hash table.
(invalidate_memory): Remove WRITES argument, simplify appropriately.
Fix all callers.
(note_mem_written): Similarly for WRITE_PTR argument.
(invalidate_from_clobbers): Similarly for W argument.
(invalidate_for_call): Remove memory elements from the hash table.
(refers_to_mem_p, cse_rtx_addr_varies_p): Deleted.
(cse_rtx_varies_p): New function. Derived from old
cse_rtx_addr_varies_p.
(cse_insn): Remove WRITES_MEMORY and INIT variables and all references.
Don't call note_mem_written anymore. Stack pushes invalidate the stack
pointer if PUSH_ROUNDING is defined. No longer need to call
cse_rtx_addr_varies_p to decide if a MEM should be invalidated.
(skipped_writes_memory): Remove variable.
(invalidate_skipped_set): Simplify and wewrite to use invalidate_memory.
(invalidate_skipped_block): Simplify for new alias analysis code.
(cse_set_around_loop): Likewise.
(cse_main): Call init_alias_analysis.
* flags.h (flag_alias_check, flag_argument_noalias): Declare.
* toplev.c (flag_alias_check, flag_argument_noalias): Define.
(f_options): Add new alias checking arguments.
(main): Set flag_alias_check when optimizing.
* local_alloc (validate_equiv_mem_from_store): Add new arguments
to true_dependence.
(memref_referenced_p): Likewise.
* loop.c (NUM_STORES): Increase to 30.
(prescan_loop): Only non-constant calls set unknown_address_altered.
(invariant_p): Add new arguments to true_dependence.
(record_giv): Initialize unrolled and shared fields.
(emit_iv_add_mult): Call record_base_value as needed.
* loop.h (struct induction): Add unrolled and shared fields.
* unroll.c (unroll_loop): Call record_base_value as needed.
(copy_loop_body): Likewise.
(final_biv_value): Likewise.
(final_giv_value): Likewise.
(find_splittable_regs): Likewise. Only create one new pseudo
if we have multiple address GIVs that were combined with the same
dst_reg GIV. Note when a new register is created due to unrolling.
* rtl.c (reg_note_name): Add REG_NOALIAS.
* rtl.h (enum reg_note): Similarly.
(rtx_varies_p, may_trap_p, side_effects_p): Declare.
(volatile_refs_p, volatile_insn_p, remove_note): Likewise.
(note_stores, refers_to_regno_p, reg_overlap_mentioned_p): Likewise.
(true_dependence, read_dependence, anti_dependence): Likewise.
(output_dependence, init_alias_analysis, end_alias_analysis): Likewise.
(mark_user_reg, mark_reg_pointer): Likewise.
jfc's alias analysis code.
From-SVN: r14768
1997-08-11 22:07:24 +02:00
|
|
|
|
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_insn_hoist (loop, gen_move_insn (tem, bl->biv->src_reg));
|
|
|
|
|
loop_insn_hoist (loop, gen_move_insn (bl->biv->src_reg,
|
|
|
|
|
biv_final_value));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream, "Biv %d mapped to %d for split.\n",
|
|
|
|
|
REGNO (bl->biv->src_reg), REGNO (tem));
|
|
|
|
|
|
|
|
|
|
/* Set up the mapping from the original biv register to the new
|
|
|
|
|
register. */
|
|
|
|
|
bl->biv->src_reg = tem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For every giv based on the biv BL, check to determine whether it is
|
1993-10-11 22:02:37 +01:00
|
|
|
|
splittable. This is a subroutine to find_splittable_regs ().
|
|
|
|
|
|
|
|
|
|
Return the number of instructions that set splittable registers. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
static int
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
find_splittable_givs (loop, bl, unroll_type, increment, unroll_number)
|
|
|
|
|
const struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
struct iv_class *bl;
|
|
|
|
|
enum unroll_types unroll_type;
|
|
|
|
|
rtx increment;
|
2002-07-30 01:57:52 +02:00
|
|
|
|
int unroll_number ATTRIBUTE_UNUSED;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
1995-01-21 03:12:01 +01:00
|
|
|
|
struct induction *v, *v2;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx final_value;
|
|
|
|
|
rtx tem;
|
1993-10-11 22:02:37 +01:00
|
|
|
|
int result = 0;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1995-01-21 03:12:01 +01:00
|
|
|
|
/* Scan the list of givs, and set the same_insn field when there are
|
|
|
|
|
multiple identical givs in the same insn. */
|
|
|
|
|
for (v = bl->giv; v; v = v->next_iv)
|
|
|
|
|
for (v2 = v->next_iv; v2; v2 = v2->next_iv)
|
|
|
|
|
if (v->insn == v2->insn && rtx_equal_p (v->new_reg, v2->new_reg)
|
|
|
|
|
&& ! v2->same_insn)
|
|
|
|
|
v2->same_insn = v;
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
for (v = bl->giv; v; v = v->next_iv)
|
|
|
|
|
{
|
|
|
|
|
rtx giv_inc, value;
|
|
|
|
|
|
|
|
|
|
/* Only split the giv if it has already been reduced, or if the loop is
|
|
|
|
|
being completely unrolled. */
|
|
|
|
|
if (unroll_type != UNROLL_COMPLETELY && v->ignore)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* The giv can be split if the insn that sets the giv is executed once
|
|
|
|
|
and only once on every iteration of the loop. */
|
|
|
|
|
/* An address giv can always be split. v->insn is just a use not a set,
|
|
|
|
|
and hence it does not matter whether it is always executed. All that
|
|
|
|
|
matters is that all the biv increments are always executed, and we
|
|
|
|
|
won't reach here if they aren't. */
|
|
|
|
|
if (v->giv_type != DEST_ADDR
|
|
|
|
|
&& (! v->always_computable
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
|| back_branch_in_range_p (loop, v->insn)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
continue;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The giv increment value must be a constant. */
|
|
|
|
|
giv_inc = fold_rtx_mult_add (v->mult_val, increment, const0_rtx,
|
|
|
|
|
v->mode);
|
|
|
|
|
if (! giv_inc || GET_CODE (giv_inc) != CONST_INT)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
/* The loop must be unrolled completely, or else have a known number of
|
|
|
|
|
iterations and only one exit, or else the giv must be dead outside
|
|
|
|
|
the loop, or else the final value of the giv must be known.
|
|
|
|
|
Otherwise, it is not safe to split the giv since it may not have the
|
|
|
|
|
proper value on loop exit. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The used outside loop test will fail for DEST_ADDR givs. They are
|
|
|
|
|
never used outside the loop anyways, so it is always safe to split a
|
|
|
|
|
DEST_ADDR giv. */
|
|
|
|
|
|
|
|
|
|
final_value = 0;
|
|
|
|
|
if (unroll_type != UNROLL_COMPLETELY
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
&& (loop->exit_count || unroll_type == UNROLL_NAIVE)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
&& v->giv_type != DEST_ADDR
|
1997-12-02 21:57:41 +01:00
|
|
|
|
/* The next part is true if the pseudo is used outside the loop.
|
|
|
|
|
We assume that this is true for any pseudo created after loop
|
|
|
|
|
starts, because we don't have a reg_n_info entry for them. */
|
|
|
|
|
&& (REGNO (v->dest_reg) >= max_reg_before_loop
|
|
|
|
|
|| (REGNO_FIRST_UID (REGNO (v->dest_reg)) != INSN_UID (v->insn)
|
|
|
|
|
/* Check for the case where the pseudo is set by a shift/add
|
|
|
|
|
sequence, in which case the first insn setting the pseudo
|
|
|
|
|
is the first insn of the shift/add sequence. */
|
|
|
|
|
&& (! (tem = find_reg_note (v->insn, REG_RETVAL, NULL_RTX))
|
|
|
|
|
|| (REGNO_FIRST_UID (REGNO (v->dest_reg))
|
|
|
|
|
!= INSN_UID (XEXP (tem, 0)))))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Line above always fails if INSN was moved by loop opt. */
|
2001-01-01 01:14:30 +01:00
|
|
|
|
|| (REGNO_LAST_LUID (REGNO (v->dest_reg))
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
>= INSN_LUID (loop->end)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
&& ! (final_value = v->final_value))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
/* Currently, non-reduced/final-value givs are never split. */
|
|
|
|
|
/* Should emit insns after the loop if possible, as the biv final value
|
|
|
|
|
code below does. */
|
|
|
|
|
|
2002-09-27 14:48:07 +02:00
|
|
|
|
/* If the final value is nonzero, and the giv has not been reduced,
|
1992-02-08 04:27:38 +01:00
|
|
|
|
then must emit an instruction to set the final value. */
|
|
|
|
|
if (final_value && !v->new_reg)
|
|
|
|
|
{
|
|
|
|
|
/* Create a new register to hold the value of the giv, and then set
|
|
|
|
|
the giv to its final value before the loop start. The giv is set
|
|
|
|
|
to its final value before loop start to ensure that this insn
|
|
|
|
|
will always be executed, no matter how we exit. */
|
|
|
|
|
tem = gen_reg_rtx (v->mode);
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_insn_hoist (loop, gen_move_insn (tem, v->dest_reg));
|
|
|
|
|
loop_insn_hoist (loop, gen_move_insn (v->dest_reg, final_value));
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream, "Giv %d mapped to %d for split.\n",
|
|
|
|
|
REGNO (v->dest_reg), REGNO (tem));
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
v->src_reg = tem;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* This giv is splittable. If completely unrolling the loop, save the
|
|
|
|
|
giv's initial value. Otherwise, save the constant zero for it. */
|
|
|
|
|
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY)
|
1992-09-19 21:50:23 +02:00
|
|
|
|
{
|
|
|
|
|
/* It is not safe to use bl->initial_value here, because it may not
|
|
|
|
|
be invariant. It is safe to use the initial value stored in
|
|
|
|
|
the splittable_regs array if it is set. In rare cases, it won't
|
|
|
|
|
be set, so then we do exactly the same thing as
|
|
|
|
|
find_splittable_regs does to get a safe value. */
|
|
|
|
|
rtx biv_initial_value;
|
|
|
|
|
|
|
|
|
|
if (splittable_regs[bl->regno])
|
|
|
|
|
biv_initial_value = splittable_regs[bl->regno];
|
|
|
|
|
else if (GET_CODE (bl->initial_value) != REG
|
|
|
|
|
|| (REGNO (bl->initial_value) != bl->regno
|
|
|
|
|
&& REGNO (bl->initial_value) >= FIRST_PSEUDO_REGISTER))
|
|
|
|
|
biv_initial_value = bl->initial_value;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx tem = gen_reg_rtx (bl->biv->mode);
|
|
|
|
|
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem), bl->biv->add_val, 0);
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_insn_hoist (loop, gen_move_insn (tem, bl->biv->src_reg));
|
1992-09-19 21:50:23 +02:00
|
|
|
|
biv_initial_value = tem;
|
|
|
|
|
}
|
2000-09-08 00:26:37 +02:00
|
|
|
|
biv_initial_value = extend_value_for_giv (v, biv_initial_value);
|
1992-09-19 21:50:23 +02:00
|
|
|
|
value = fold_rtx_mult_add (v->mult_val, biv_initial_value,
|
|
|
|
|
v->add_val, v->mode);
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
|
|
|
|
value = const0_rtx;
|
|
|
|
|
|
|
|
|
|
if (v->new_reg)
|
|
|
|
|
{
|
1992-04-27 18:55:54 +02:00
|
|
|
|
/* If a giv was combined with another giv, then we can only split
|
|
|
|
|
this giv if the giv it was combined with was reduced. This
|
|
|
|
|
is because the value of v->new_reg is meaningless in this
|
|
|
|
|
case. */
|
|
|
|
|
if (v->same && ! v->same->new_reg)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
1992-04-27 18:55:54 +02:00
|
|
|
|
"giv combined with unreduced giv not split.\n");
|
|
|
|
|
continue;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1992-04-27 18:55:54 +02:00
|
|
|
|
/* If the giv is an address destination, it could be something other
|
|
|
|
|
than a simple register, these have to be treated differently. */
|
|
|
|
|
else if (v->giv_type == DEST_REG)
|
1992-05-28 00:10:02 +02:00
|
|
|
|
{
|
|
|
|
|
/* If value is not a constant, register, or register plus
|
|
|
|
|
constant, then compute its value into a register before
|
1995-01-25 20:50:09 +01:00
|
|
|
|
loop start. This prevents invalid rtx sharing, and should
|
1992-05-28 00:10:02 +02:00
|
|
|
|
generate better code. We can use bl->initial_value here
|
|
|
|
|
instead of splittable_regs[bl->regno] because this code
|
|
|
|
|
is going before the loop start. */
|
|
|
|
|
if (unroll_type == UNROLL_COMPLETELY
|
|
|
|
|
&& GET_CODE (value) != CONST_INT
|
|
|
|
|
&& GET_CODE (value) != REG
|
|
|
|
|
&& (GET_CODE (value) != PLUS
|
|
|
|
|
|| GET_CODE (XEXP (value, 0)) != REG
|
|
|
|
|
|| GET_CODE (XEXP (value, 1)) != CONST_INT))
|
|
|
|
|
{
|
|
|
|
|
rtx tem = gen_reg_rtx (v->mode);
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem), v->add_val, 0);
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_iv_add_mult_hoist (loop, bl->initial_value, v->mult_val,
|
|
|
|
|
v->add_val, tem);
|
1992-05-28 00:10:02 +02:00
|
|
|
|
value = tem;
|
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
2002-09-30 21:35:17 +02:00
|
|
|
|
splittable_regs[reg_or_subregno (v->new_reg)] = value;
|
1992-05-28 00:10:02 +02:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
2002-07-30 01:57:52 +02:00
|
|
|
|
continue;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
#if 0
|
|
|
|
|
/* Currently, unreduced giv's can't be split. This is not too much
|
|
|
|
|
of a problem since unreduced giv's are not live across loop
|
|
|
|
|
iterations anyways. When unrolling a loop completely though,
|
|
|
|
|
it makes sense to reduce&split givs when possible, as this will
|
|
|
|
|
result in simpler instructions, and will not require that a reg
|
|
|
|
|
be live across loop iterations. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
splittable_regs[REGNO (v->dest_reg)] = value;
|
|
|
|
|
fprintf (stderr, "Giv %d at insn %d not reduced\n",
|
|
|
|
|
REGNO (v->dest_reg), INSN_UID (v->insn));
|
|
|
|
|
#else
|
|
|
|
|
continue;
|
|
|
|
|
#endif
|
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1997-06-24 04:47:33 +02:00
|
|
|
|
/* Unreduced givs are only updated once by definition. Reduced givs
|
|
|
|
|
are updated as many times as their biv is. Mark it so if this is
|
1992-02-08 04:27:38 +01:00
|
|
|
|
a splittable register. Don't need to do anything for address givs
|
|
|
|
|
where this may not be a register. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (v->new_reg) == REG)
|
1997-06-24 04:47:33 +02:00
|
|
|
|
{
|
|
|
|
|
int count = 1;
|
|
|
|
|
if (! v->ignore)
|
2001-01-01 01:37:09 +01:00
|
|
|
|
count = REG_IV_CLASS (ivs, REGNO (v->src_reg))->biv_count;
|
1997-06-24 04:47:33 +02:00
|
|
|
|
|
2002-09-30 21:35:17 +02:00
|
|
|
|
splittable_regs_updates[reg_or_subregno (v->new_reg)] = count;
|
1997-06-24 04:47:33 +02:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
result++;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
{
|
|
|
|
|
int regnum;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (v->dest_reg) == CONST_INT)
|
|
|
|
|
regnum = -1;
|
|
|
|
|
else if (GET_CODE (v->dest_reg) != REG)
|
|
|
|
|
regnum = REGNO (XEXP (v->dest_reg, 0));
|
|
|
|
|
else
|
|
|
|
|
regnum = REGNO (v->dest_reg);
|
|
|
|
|
fprintf (loop_dump_stream, "Giv %d at insn %d safe to split.\n",
|
|
|
|
|
regnum, INSN_UID (v->insn));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to prove that the register is dead after the loop exits. Trace every
|
|
|
|
|
loop exit looking for an insn that will always be executed, which sets
|
|
|
|
|
the register to some value, and appears before the first use of the register
|
|
|
|
|
is found. If successful, then return 1, otherwise return 0. */
|
|
|
|
|
|
|
|
|
|
/* ?? Could be made more intelligent in the handling of jumps, so that
|
|
|
|
|
it can search past if statements and other similar structures. */
|
|
|
|
|
|
|
|
|
|
static int
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
reg_dead_after_loop (loop, reg)
|
|
|
|
|
const struct loop *loop;
|
|
|
|
|
rtx reg;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
rtx insn, label;
|
|
|
|
|
enum rtx_code code;
|
1992-03-03 14:06:22 +01:00
|
|
|
|
int jump_count = 0;
|
1995-07-14 14:27:10 +02:00
|
|
|
|
int label_count = 0;
|
|
|
|
|
|
|
|
|
|
/* In addition to checking all exits of this loop, we must also check
|
|
|
|
|
all exits of inner nested loops that would exit this loop. We don't
|
|
|
|
|
have any way to identify those, so we just give up if there are any
|
|
|
|
|
such inner loop exits. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
for (label = loop->exit_labels; label; label = LABEL_NEXTREF (label))
|
1995-07-14 14:27:10 +02:00
|
|
|
|
label_count++;
|
|
|
|
|
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
if (label_count != loop->exit_count)
|
1995-07-14 14:27:10 +02:00
|
|
|
|
return 0;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* HACK: Must also search the loop fall through exit, create a label_ref
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
here which points to the loop->end, and append the loop_number_exit_labels
|
1992-02-08 04:27:38 +01:00
|
|
|
|
list to it. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
label = gen_rtx_LABEL_REF (VOIDmode, loop->end);
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
LABEL_NEXTREF (label) = loop->exit_labels;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2000-09-12 16:43:25 +02:00
|
|
|
|
for (; label; label = LABEL_NEXTREF (label))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
/* Succeed if find an insn which sets the biv or if reach end of
|
|
|
|
|
function. Fail if find an insn that uses the biv, or if come to
|
|
|
|
|
a conditional jump. */
|
|
|
|
|
|
|
|
|
|
insn = NEXT_INSN (XEXP (label, 0));
|
1992-03-03 14:06:22 +01:00
|
|
|
|
while (insn)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1992-03-03 14:06:22 +01:00
|
|
|
|
code = GET_CODE (insn);
|
|
|
|
|
if (GET_RTX_CLASS (code) == 'i')
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1992-03-03 14:06:22 +01:00
|
|
|
|
rtx set;
|
|
|
|
|
|
|
|
|
|
if (reg_referenced_p (reg, PATTERN (insn)))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
1992-03-03 14:06:22 +01:00
|
|
|
|
|
|
|
|
|
set = single_set (insn);
|
|
|
|
|
if (set && rtx_equal_p (SET_DEST (set), reg))
|
|
|
|
|
break;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1992-03-03 14:06:22 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (code == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (PATTERN (insn)) == RETURN)
|
|
|
|
|
break;
|
combine.c (try_combine): Use any_condjump_p...
* combine.c (try_combine): Use any_condjump_p, any_uncondjump_p
and pc_set at the place of simplejump_p and condjump_p.
* cse.c (record_jump_equiv): Likewise.
* emit-rtl.c (emit): Likewise.
* explow.c (find_next_ref): Likewise.
* flow.c (tidy_fallthru_edge): Likewise.
(init_propagate_block_info): Likewise.
* gcse.c (delete_null_pointer_checks): Likewise.
* ifcvt.c (cond_exec_get_condition, noce_get_condition,
dead_or_predicable): Likewise.
* integrate.c (copy_insn_list): Likewise.
* loop.c (scan_loop, verify_dominator, find_and_verify_loops,
for_each_insn_in_loop, check_dbra_loop, get_condition,
insert_bct, load_mems): Likewise.
* resource.c (find_dead_or_set_registers): Likewise.
* sibcalls.c (simplejump_p): Likewise.
* unroll.c (copy_loop_body, reg_dead_after_loop): Likewise.
From-SVN: r34175
2000-05-25 23:38:49 +02:00
|
|
|
|
else if (!any_uncondjump_p (insn)
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* Prevent infinite loop following infinite loops. */
|
1992-03-03 14:06:22 +01:00
|
|
|
|
|| jump_count++ > 20)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
else
|
1992-03-03 14:06:22 +01:00
|
|
|
|
insn = JUMP_LABEL (insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1992-03-03 14:06:22 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Success, the register is dead on all loop exits. */
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to calculate the final value of the biv, the value it will have at
|
|
|
|
|
the end of the loop. If we can do it, return that value. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
final_biv_value (loop, bl)
|
|
|
|
|
const struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
struct iv_class *bl;
|
|
|
|
|
{
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
unsigned HOST_WIDE_INT n_iterations = LOOP_INFO (loop)->n_iterations;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx increment, tem;
|
|
|
|
|
|
1992-03-14 06:17:01 +01:00
|
|
|
|
/* ??? This only works for MODE_INT biv's. Reject all others for now. */
|
|
|
|
|
|
|
|
|
|
if (GET_MODE_CLASS (bl->biv->mode) != MODE_INT)
|
|
|
|
|
return 0;
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The final value for reversed bivs must be calculated differently than
|
2000-09-12 16:43:25 +02:00
|
|
|
|
for ordinary bivs. In this case, there is already an insn after the
|
1992-02-08 04:27:38 +01:00
|
|
|
|
loop which sets this biv's final value (if necessary), and there are
|
|
|
|
|
no other loop exits, so we can return any value. */
|
|
|
|
|
if (bl->reversed)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Final biv value for %d, reversed biv.\n", bl->regno);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return const0_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to calculate the final value as initial value + (number of iterations
|
|
|
|
|
* increment). For this to work, increment must be invariant, the only
|
|
|
|
|
exit from the loop must be the fall through at the bottom (otherwise
|
|
|
|
|
it may not have its final value when the loop exits), and the initial
|
|
|
|
|
value of the biv must be invariant. */
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (n_iterations != 0
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
&& ! loop->exit_count
|
|
|
|
|
&& loop_invariant_p (loop, bl->initial_value))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
increment = biv_total_increment (bl);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (increment && loop_invariant_p (loop, increment))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
/* Can calculate the loop exit value, emit insns after loop
|
|
|
|
|
end to calculate this value into a temporary register in
|
|
|
|
|
case it is needed later. */
|
|
|
|
|
|
|
|
|
|
tem = gen_reg_rtx (bl->biv->mode);
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem), bl->biv->add_val, 0);
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_iv_add_mult_sink (loop, increment, GEN_INT (n_iterations),
|
|
|
|
|
bl->initial_value, tem);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Final biv value for %d, calculated.\n", bl->regno);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check to see if the biv is dead at all loop exits. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (reg_dead_after_loop (loop, bl->biv->src_reg))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Final biv value for %d, biv dead after loop exit.\n",
|
|
|
|
|
bl->regno);
|
|
|
|
|
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to calculate the final value of the giv, the value it will have at
|
|
|
|
|
the end of the loop. If we can do it, return that value. */
|
|
|
|
|
|
|
|
|
|
rtx
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
final_giv_value (loop, v)
|
|
|
|
|
const struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
struct induction *v;
|
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
struct iv_class *bl;
|
1992-09-19 21:50:23 +02:00
|
|
|
|
rtx insn;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx increment, tem;
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
rtx seq;
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
rtx loop_end = loop->end;
|
|
|
|
|
unsigned HOST_WIDE_INT n_iterations = LOOP_INFO (loop)->n_iterations;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2001-01-01 01:37:09 +01:00
|
|
|
|
bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* The final value for givs which depend on reversed bivs must be calculated
|
|
|
|
|
differently than for ordinary givs. In this case, there is already an
|
|
|
|
|
insn after the loop which sets this giv's final value (if necessary),
|
|
|
|
|
and there are no other loop exits, so we can return any value. */
|
|
|
|
|
if (bl->reversed)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Final giv value for %d, depends on reversed biv\n",
|
|
|
|
|
REGNO (v->dest_reg));
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to calculate the final value as a function of the biv it depends
|
|
|
|
|
upon. The only exit from the loop must be the fall through at the bottom
|
2002-06-15 03:10:49 +02:00
|
|
|
|
and the insn that sets the giv must be executed on every iteration
|
|
|
|
|
(otherwise the giv may not have its final value when the loop exits). */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* ??? Can calculate the final giv value by subtracting off the
|
|
|
|
|
extra biv increments times the giv's mult_val. The loop must have
|
|
|
|
|
only one exit for this to work, but the loop iterations does not need
|
|
|
|
|
to be known. */
|
|
|
|
|
|
1998-11-25 22:19:21 +01:00
|
|
|
|
if (n_iterations != 0
|
2002-06-15 03:10:49 +02:00
|
|
|
|
&& ! loop->exit_count
|
|
|
|
|
&& v->always_executed)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
/* ?? It is tempting to use the biv's value here since these insns will
|
|
|
|
|
be put after the loop, and hence the biv will have its final value
|
|
|
|
|
then. However, this fails if the biv is subsequently eliminated.
|
|
|
|
|
Perhaps determine whether biv's are eliminable before trying to
|
|
|
|
|
determine whether giv's are replaceable so that we can use the
|
|
|
|
|
biv value here if it is not eliminable. */
|
|
|
|
|
|
1997-06-26 01:53:40 +02:00
|
|
|
|
/* We are emitting code after the end of the loop, so we must make
|
|
|
|
|
sure that bl->initial_value is still valid then. It will still
|
|
|
|
|
be valid if it is invariant. */
|
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
increment = biv_total_increment (bl);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (increment && loop_invariant_p (loop, increment)
|
|
|
|
|
&& loop_invariant_p (loop, bl->initial_value))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
/* Can calculate the loop exit value of its biv as
|
1998-11-25 22:19:21 +01:00
|
|
|
|
(n_iterations * increment) + initial_value */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* The loop exit value of the giv is then
|
|
|
|
|
(final_biv_value - extra increments) * mult_val + add_val.
|
|
|
|
|
The extra increments are any increments to the biv which
|
|
|
|
|
occur in the loop after the giv's value is calculated.
|
|
|
|
|
We must search from the insn that sets the giv to the end
|
|
|
|
|
of the loop to calculate this value. */
|
|
|
|
|
|
|
|
|
|
/* Put the final biv value in tem. */
|
2000-09-08 00:26:37 +02:00
|
|
|
|
tem = gen_reg_rtx (v->mode);
|
1998-04-25 18:09:24 +02:00
|
|
|
|
record_base_value (REGNO (tem), bl->biv->add_val, 0);
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_iv_add_mult_sink (loop, extend_value_for_giv (v, increment),
|
|
|
|
|
GEN_INT (n_iterations),
|
|
|
|
|
extend_value_for_giv (v, bl->initial_value),
|
|
|
|
|
tem);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Subtract off extra increments as we find them. */
|
|
|
|
|
for (insn = NEXT_INSN (v->insn); insn != loop_end;
|
|
|
|
|
insn = NEXT_INSN (insn))
|
|
|
|
|
{
|
1992-09-19 21:50:23 +02:00
|
|
|
|
struct induction *biv;
|
|
|
|
|
|
|
|
|
|
for (biv = bl->biv; biv; biv = biv->next_iv)
|
|
|
|
|
if (biv->insn == insn)
|
|
|
|
|
{
|
|
|
|
|
start_sequence ();
|
optabs.h (OTI_flodiv, [...]): Kill.
* optabs.h (OTI_flodiv, flodiv_optab): Kill.
* genopinit.c: Put floating point divide insns in sdiv_optab.
* expr.c (expand_expr): Use sdiv_optab, not flodiv_optab.
* config/gofast.h, config/c4x/c4x.h,
config/ia64/hpux_longdouble.h, config/mips/mips.h,
config/pa/long_double.h, config/rs6000/sysv4.h,
config/sparc/sparc.h: Put floating point divide libcalls in sdiv_optab.
* optabs.c (init_optab): Break into new_optab, init_optab, init_optabv.
(init_optabs): Use init_optabv for overflow-trapping optabs.
Don't init flodiv_optab. Give mov_optab, movstrict_optab, and
cmp_optab RTX codes so have_insn_for can find them.
* optabs.c (expand_simple_binop, expand_simple_unop,
have_insn_for, gen_sub3_insn): New interfaces.
* expr.h: Prototype new functions.
(enum optab_methods): Move here from optabs.h.
* builtins.c, combine.c, doloop.c, function.c, ifcvt.c,
loop.c, profile.c, simplify-rtx.c, stmt.c, unroll.c:
Use new functions instead of working directly with optabs.
* doloop.c, ifcvt.c, loop.c, profile.c, simplify-rtx.c,
unroll.c: Don't include optabs.h.
* caller-save.c, combine.c, function.c, stmt.c: Just include
insn-codes.h, not optabs.h.
* Makefile.in: Update dependencies.
* combine.c (make_compound_operation, simplify_comparison):
Fix typos testing for this or that instruction.
From-SVN: r45008
2001-08-18 21:59:46 +02:00
|
|
|
|
tem = expand_simple_binop (GET_MODE (tem), MINUS, tem,
|
|
|
|
|
biv->add_val, NULL_RTX, 0,
|
|
|
|
|
OPTAB_LIB_WIDEN);
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
seq = get_insns ();
|
1992-09-19 21:50:23 +02:00
|
|
|
|
end_sequence ();
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_insn_sink (loop, seq);
|
1992-09-19 21:50:23 +02:00
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* Now calculate the giv's final value. */
|
hard-reg-set.h: Add multiple include guard.
* hard-reg-set.h: Add multiple include guard.
* basic-block.h (struct loop): Add `sink' field.
* loop.h: Include sbitmap.h, hard-reg-set.h, and basic-block.h.
(emit_iv_add_mult): Delete.
(loop_iv_add_mult_hoist, loop_iv_add_mult_sink): Define.
(loop_iv_add_mult_emit_before, loop_insn_sink): Define.
(unroll_loop): Remove end_insert_before argument.
* loop.c (loop_givs_rescan): Remove end_insert_before argument.
(maybe_eliminate_biv_1): Likewise.
(emit_iv_add_mult): Delete.
(gen_add_mult, loop_regs_update): New.
(loop_insn_emit_after, loop_insn_emit_before): New.
(loop_insn_sink, loop_insn_sink_or_swim): New.
(emit_iv_add_mult): Delete.
(scan_loop): Set loop->sink.
(loop_givs_reduce): Use loop_insn_sink and its ilk.
(loop_givs_rescan, strength_reduce, check_dbra_loop): Likewise.
(maybe_eliminate_biv_1): Likewise.
(maybe_eliminate_biv_1): Add basic block argument.
* unroll.c (unroll_loop): Remove end_insert_before argument.
(find_splittable_regs): Likewise.
(find_splittable_regs): Use loop_insn_sink and its ilk.
(find_splittable_givs, final_biv_value, final_giv_value): Likewise.
From-SVN: r38766
2001-01-07 11:38:29 +01:00
|
|
|
|
loop_iv_add_mult_sink (loop, tem, v->mult_val, v->add_val, tem);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Final giv value for %d, calc from biv's value.\n",
|
|
|
|
|
REGNO (v->dest_reg));
|
|
|
|
|
|
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Replaceable giv's should never reach here. */
|
|
|
|
|
if (v->replaceable)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
/* Check to see if the biv is dead at all loop exits. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (reg_dead_after_loop (loop, v->dest_reg))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Final giv value for %d, giv dead after loop exit.\n",
|
|
|
|
|
REGNO (v->dest_reg));
|
|
|
|
|
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2001-09-11 02:20:23 +02:00
|
|
|
|
/* Look back before LOOP->START for the insn that sets REG and return
|
1998-11-25 22:32:27 +01:00
|
|
|
|
the equivalent constant if there is a REG_EQUAL note otherwise just
|
|
|
|
|
the SET_SRC of REG. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
loop_find_equiv_value (loop, reg)
|
|
|
|
|
const struct loop *loop;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
rtx reg;
|
|
|
|
|
{
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
rtx loop_start = loop->start;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
rtx insn, set;
|
|
|
|
|
rtx ret;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
ret = reg;
|
2000-09-12 16:43:25 +02:00
|
|
|
|
for (insn = PREV_INSN (loop_start); insn; insn = PREV_INSN (insn))
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (insn) == CODE_LABEL)
|
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
2000-08-04 22:28:08 +02:00
|
|
|
|
else if (INSN_P (insn) && reg_set_p (reg, insn))
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
|
|
|
|
/* We found the last insn before the loop that sets the register.
|
|
|
|
|
If it sets the entire register, and has a REG_EQUAL note,
|
|
|
|
|
then use the value of the REG_EQUAL note. */
|
|
|
|
|
if ((set = single_set (insn))
|
2000-09-12 16:43:25 +02:00
|
|
|
|
&& (SET_DEST (set) == reg))
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
|
|
|
|
rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
/* Only use the REG_EQUAL note if it is a constant.
|
|
|
|
|
Other things, divide in particular, will cause
|
|
|
|
|
problems later if we use them. */
|
|
|
|
|
if (note && GET_CODE (XEXP (note, 0)) != EXPR_LIST
|
|
|
|
|
&& CONSTANT_P (XEXP (note, 0)))
|
|
|
|
|
ret = XEXP (note, 0);
|
|
|
|
|
else
|
|
|
|
|
ret = SET_SRC (set);
|
2000-08-21 21:58:35 +02:00
|
|
|
|
|
|
|
|
|
/* We cannot do this if it changes between the
|
|
|
|
|
assignment and loop start though. */
|
|
|
|
|
if (modified_between_p (ret, insn, loop_start))
|
|
|
|
|
ret = reg;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
/* Return a simplified rtx for the expression OP - REG.
|
|
|
|
|
|
|
|
|
|
REG must appear in OP, and OP must be a register or the sum of a register
|
|
|
|
|
and a second term.
|
|
|
|
|
|
|
|
|
|
Thus, the return value must be const0_rtx or the second term.
|
|
|
|
|
|
|
|
|
|
The caller is responsible for verifying that REG appears in OP and OP has
|
|
|
|
|
the proper form. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
subtract_reg_term (op, reg)
|
|
|
|
|
rtx op, reg;
|
|
|
|
|
{
|
|
|
|
|
if (op == reg)
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
if (GET_CODE (op) == PLUS)
|
|
|
|
|
{
|
|
|
|
|
if (XEXP (op, 0) == reg)
|
|
|
|
|
return XEXP (op, 1);
|
|
|
|
|
else if (XEXP (op, 1) == reg)
|
|
|
|
|
return XEXP (op, 0);
|
|
|
|
|
}
|
|
|
|
|
/* OP does not contain REG as a term. */
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find and return register term common to both expressions OP0 and
|
|
|
|
|
OP1 or NULL_RTX if no such term exists. Each expression must be a
|
|
|
|
|
REG or a PLUS of a REG. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
find_common_reg_term (op0, op1)
|
|
|
|
|
rtx op0, op1;
|
|
|
|
|
{
|
|
|
|
|
if ((GET_CODE (op0) == REG || GET_CODE (op0) == PLUS)
|
|
|
|
|
&& (GET_CODE (op1) == REG || GET_CODE (op1) == PLUS))
|
|
|
|
|
{
|
|
|
|
|
rtx op00;
|
|
|
|
|
rtx op01;
|
|
|
|
|
rtx op10;
|
|
|
|
|
rtx op11;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op0) == PLUS)
|
|
|
|
|
op01 = XEXP (op0, 1), op00 = XEXP (op0, 0);
|
|
|
|
|
else
|
|
|
|
|
op01 = const0_rtx, op00 = op0;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op1) == PLUS)
|
|
|
|
|
op11 = XEXP (op1, 1), op10 = XEXP (op1, 0);
|
|
|
|
|
else
|
|
|
|
|
op11 = const0_rtx, op10 = op1;
|
|
|
|
|
|
|
|
|
|
/* Find and return common register term if present. */
|
|
|
|
|
if (REG_P (op00) && (op00 == op10 || op00 == op11))
|
|
|
|
|
return op00;
|
|
|
|
|
else if (REG_P (op01) && (op01 == op10 || op01 == op11))
|
|
|
|
|
return op01;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* No common register term found. */
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-11 23:44:21 +02:00
|
|
|
|
/* Determine the loop iterator and calculate the number of loop
|
|
|
|
|
iterations. Returns the exact number of loop iterations if it can
|
|
|
|
|
be calculated, otherwise returns zero. */
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1992-07-06 22:15:06 +02:00
|
|
|
|
unsigned HOST_WIDE_INT
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
loop_iterations (loop)
|
|
|
|
|
struct loop *loop;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_info *loop_info = LOOP_INFO (loop);
|
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx comparison, comparison_value;
|
|
|
|
|
rtx iteration_var, initial_value, increment, final_value;
|
|
|
|
|
enum rtx_code comparison_code;
|
2001-05-06 21:51:19 +02:00
|
|
|
|
HOST_WIDE_INT inc;
|
|
|
|
|
unsigned HOST_WIDE_INT abs_inc;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
unsigned HOST_WIDE_INT abs_diff;
|
|
|
|
|
int off_by_one;
|
1992-07-06 22:15:06 +02:00
|
|
|
|
int increment_dir;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
int unsigned_p, compare_dir, final_larger;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
rtx last_loop_insn;
|
1998-12-15 21:31:18 +01:00
|
|
|
|
rtx reg_term;
|
2000-09-11 23:44:21 +02:00
|
|
|
|
struct iv_class *bl;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->n_iterations = 0;
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->initial_value = 0;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->initial_equiv_value = 0;
|
|
|
|
|
loop_info->comparison_value = 0;
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->final_value = 0;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->final_equiv_value = 0;
|
|
|
|
|
loop_info->increment = 0;
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->iteration_var = 0;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->unroll_number = 1;
|
2000-09-11 23:44:21 +02:00
|
|
|
|
loop_info->iv = 0;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
/* We used to use prev_nonnote_insn here, but that fails because it might
|
1994-08-15 01:13:22 +02:00
|
|
|
|
accidentally get the branch for a contained loop if the branch for this
|
|
|
|
|
loop was deleted. We can only trust branches immediately before the
|
|
|
|
|
loop_end. */
|
2002-10-02 04:48:10 +02:00
|
|
|
|
last_loop_insn = PREV_INSN (loop->end);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1999-01-15 11:05:56 +01:00
|
|
|
|
/* ??? We should probably try harder to find the jump insn
|
1999-02-04 23:55:55 +01:00
|
|
|
|
at the end of the loop. The following code assumes that
|
1999-01-15 11:05:56 +01:00
|
|
|
|
the last loop insn is a jump to the top of the loop. */
|
|
|
|
|
if (GET_CODE (last_loop_insn) != JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: No final conditional branch found.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If there is a more than a single jump to the top of the loop
|
|
|
|
|
we cannot (easily) determine the iteration count. */
|
|
|
|
|
if (LABEL_NUSES (JUMP_LABEL (last_loop_insn)) > 1)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Loop has multiple back edges.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2001-10-08 23:20:43 +02:00
|
|
|
|
/* If there are multiple conditionalized loop exit tests, they may jump
|
|
|
|
|
back to differing CODE_LABELs. */
|
|
|
|
|
if (loop->top && loop->cont)
|
|
|
|
|
{
|
|
|
|
|
rtx temp = PREV_INSN (last_loop_insn);
|
|
|
|
|
|
|
|
|
|
do
|
|
|
|
|
{
|
2001-12-01 13:04:16 +01:00
|
|
|
|
if (GET_CODE (temp) == JUMP_INSN)
|
2001-10-08 23:20:43 +02:00
|
|
|
|
{
|
2001-12-01 13:04:16 +01:00
|
|
|
|
/* There are some kinds of jumps we can't deal with easily. */
|
|
|
|
|
if (JUMP_LABEL (temp) == 0)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf
|
|
|
|
|
(loop_dump_stream,
|
|
|
|
|
"Loop iterations: Jump insn has null JUMP_LABEL.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (/* Previous unrolling may have generated new insns not
|
|
|
|
|
covered by the uid_luid array. */
|
|
|
|
|
INSN_UID (JUMP_LABEL (temp)) < max_uid_for_loop
|
|
|
|
|
/* Check if we jump back into the loop body. */
|
|
|
|
|
&& INSN_LUID (JUMP_LABEL (temp)) > INSN_LUID (loop->top)
|
|
|
|
|
&& INSN_LUID (JUMP_LABEL (temp)) < INSN_LUID (loop->cont))
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
2002-06-01 00:15:42 +02:00
|
|
|
|
fprintf
|
2001-12-01 13:04:16 +01:00
|
|
|
|
(loop_dump_stream,
|
|
|
|
|
"Loop iterations: Loop has multiple back edges.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2001-10-08 23:20:43 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
while ((temp = PREV_INSN (temp)) != loop->cont);
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-15 11:05:56 +01:00
|
|
|
|
/* Find the iteration variable. If the last insn is a conditional
|
|
|
|
|
branch, and the insn before tests a register value, make that the
|
|
|
|
|
iteration variable. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
comparison = get_condition_for_loop (loop, last_loop_insn);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (comparison == 0)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
1999-01-15 11:05:56 +01:00
|
|
|
|
"Loop iterations: No final comparison found.\n");
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ??? Get_condition may switch position of induction variable and
|
|
|
|
|
invariant register when it canonicalizes the comparison. */
|
|
|
|
|
|
|
|
|
|
comparison_code = GET_CODE (comparison);
|
|
|
|
|
iteration_var = XEXP (comparison, 0);
|
|
|
|
|
comparison_value = XEXP (comparison, 1);
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (GET_CODE (iteration_var) != REG)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
1998-11-25 22:32:27 +01:00
|
|
|
|
"Loop iterations: Comparison not against register.\n");
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2000-01-19 12:17:13 +01:00
|
|
|
|
/* The only new registers that are created before loop iterations
|
|
|
|
|
are givs made from biv increments or registers created by
|
|
|
|
|
load_mems. In the latter case, it is possible that try_copy_prop
|
|
|
|
|
will propagate a new pseudo into the old iteration register but
|
|
|
|
|
this will be marked by having the REG_USERVAR_P bit set. */
|
|
|
|
|
|
2001-01-01 01:49:30 +01:00
|
|
|
|
if ((unsigned) REGNO (iteration_var) >= ivs->n_regs
|
2000-01-19 12:17:13 +01:00
|
|
|
|
&& ! REG_USERVAR_P (iteration_var))
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
abort ();
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
2000-09-11 23:44:21 +02:00
|
|
|
|
/* Determine the initial value of the iteration variable, and the amount
|
|
|
|
|
that it is incremented each loop. Use the tables constructed by
|
|
|
|
|
the strength reduction pass to calculate these values. */
|
|
|
|
|
|
|
|
|
|
/* Clear the result values, in case no answer can be found. */
|
|
|
|
|
initial_value = 0;
|
|
|
|
|
increment = 0;
|
|
|
|
|
|
|
|
|
|
/* The iteration variable can be either a giv or a biv. Check to see
|
|
|
|
|
which it is, and compute the variable's initial value, and increment
|
|
|
|
|
value if possible. */
|
|
|
|
|
|
|
|
|
|
/* If this is a new register, can't handle it since we don't have any
|
|
|
|
|
reg_iv_type entry for it. */
|
2001-01-01 01:49:30 +01:00
|
|
|
|
if ((unsigned) REGNO (iteration_var) >= ivs->n_regs)
|
2000-09-11 23:44:21 +02:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: No reg_iv_type entry for iteration var.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Reject iteration variables larger than the host wide int size, since they
|
|
|
|
|
could result in a number of iterations greater than the range of our
|
|
|
|
|
`unsigned HOST_WIDE_INT' variable loop_info->n_iterations. */
|
|
|
|
|
else if ((GET_MODE_BITSIZE (GET_MODE (iteration_var))
|
|
|
|
|
> HOST_BITS_PER_WIDE_INT))
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Iteration var rejected because mode too large.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_MODE_CLASS (GET_MODE (iteration_var)) != MODE_INT)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Iteration var not an integer.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2000-09-11 23:48:46 +02:00
|
|
|
|
else if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == BASIC_INDUCT)
|
2000-09-11 23:44:21 +02:00
|
|
|
|
{
|
2001-01-01 02:04:01 +01:00
|
|
|
|
if (REGNO (iteration_var) >= ivs->n_regs)
|
2000-09-11 23:44:21 +02:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
/* Grab initial value, only useful if it is a constant. */
|
2001-01-01 01:37:09 +01:00
|
|
|
|
bl = REG_IV_CLASS (ivs, REGNO (iteration_var));
|
2000-09-11 23:44:21 +02:00
|
|
|
|
initial_value = bl->initial_value;
|
2001-01-13 22:54:10 +01:00
|
|
|
|
if (!bl->biv->always_executed || bl->biv->maybe_multiple)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Basic induction var not set once in each iteration.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
2000-09-11 23:44:21 +02:00
|
|
|
|
|
|
|
|
|
increment = biv_total_increment (bl);
|
|
|
|
|
}
|
2000-09-11 23:48:46 +02:00
|
|
|
|
else if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == GENERAL_INDUCT)
|
2000-09-11 23:44:21 +02:00
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT offset = 0;
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct induction *v = REG_IV_INFO (ivs, REGNO (iteration_var));
|
2000-09-11 23:44:21 +02:00
|
|
|
|
rtx biv_initial_value;
|
|
|
|
|
|
2001-01-01 02:04:01 +01:00
|
|
|
|
if (REGNO (v->src_reg) >= ivs->n_regs)
|
2000-09-11 23:44:21 +02:00
|
|
|
|
abort ();
|
|
|
|
|
|
2001-01-13 22:54:10 +01:00
|
|
|
|
if (!v->always_executed || v->maybe_multiple)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: General induction var not set once in each iteration.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2001-01-01 01:37:09 +01:00
|
|
|
|
bl = REG_IV_CLASS (ivs, REGNO (v->src_reg));
|
2000-09-11 23:44:21 +02:00
|
|
|
|
|
|
|
|
|
/* Increment value is mult_val times the increment value of the biv. */
|
|
|
|
|
|
|
|
|
|
increment = biv_total_increment (bl);
|
|
|
|
|
if (increment)
|
|
|
|
|
{
|
|
|
|
|
struct induction *biv_inc;
|
|
|
|
|
|
2000-09-19 01:19:53 +02:00
|
|
|
|
increment = fold_rtx_mult_add (v->mult_val,
|
|
|
|
|
extend_value_for_giv (v, increment),
|
|
|
|
|
const0_rtx, v->mode);
|
ChangeLog.0, [...]: Fix spelling errors.
* ChangeLog.0, ChangeLog.1, ChangeLog.2, ChangeLog.3, ChangeLog.4,
ChangeLog.5, ChangeLog, FSFChangeLog.10, FSFChangeLog.11,
c-common.c, c-common.h, c-parse.in, c-typeck.c, cfg.c, config.gcc,
configure, configure.in, except.c, except.h, flow.c, function.c,
gcc.c, gcse.c, genrecog.c, libgcc2.c, loop.c, loop.h, params.def,
predict.def, predict.h, reg-stack.c, regmove.c, sched-deps.c,
sched-int.h, sibcall.c, ssa.c, stringpool.c, toplev.c, tree.c,
unroll.c: Fix spelling errors.
From-SVN: r46595
2001-10-28 21:09:17 +01:00
|
|
|
|
/* The caller assumes that one full increment has occurred at the
|
2000-09-11 23:44:21 +02:00
|
|
|
|
first loop test. But that's not true when the biv is incremented
|
|
|
|
|
after the giv is set (which is the usual case), e.g.:
|
|
|
|
|
i = 6; do {;} while (i++ < 9) .
|
|
|
|
|
Therefore, we bias the initial value by subtracting the amount of
|
|
|
|
|
the increment that occurs between the giv set and the giv test. */
|
|
|
|
|
for (biv_inc = bl->biv; biv_inc; biv_inc = biv_inc->next_iv)
|
|
|
|
|
{
|
|
|
|
|
if (loop_insn_first_p (v->insn, biv_inc->insn))
|
2002-02-27 16:01:10 +01:00
|
|
|
|
{
|
|
|
|
|
if (REG_P (biv_inc->add_val))
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Basic induction var add_val is REG %d.\n",
|
|
|
|
|
REGNO (biv_inc->add_val));
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
offset -= INTVAL (biv_inc->add_val);
|
|
|
|
|
}
|
2000-09-11 23:44:21 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Giv iterator, initial value bias %ld.\n",
|
|
|
|
|
(long) offset);
|
|
|
|
|
|
|
|
|
|
/* Initial value is mult_val times the biv's initial value plus
|
|
|
|
|
add_val. Only useful if it is a constant. */
|
|
|
|
|
biv_initial_value = extend_value_for_giv (v, bl->initial_value);
|
|
|
|
|
initial_value
|
|
|
|
|
= fold_rtx_mult_add (v->mult_val,
|
|
|
|
|
plus_constant (biv_initial_value, offset),
|
|
|
|
|
v->add_val, v->mode);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Not basic or general induction var.\n");
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
if (initial_value == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
unsigned_p = 0;
|
|
|
|
|
off_by_one = 0;
|
|
|
|
|
switch (comparison_code)
|
|
|
|
|
{
|
|
|
|
|
case LEU:
|
|
|
|
|
unsigned_p = 1;
|
|
|
|
|
case LE:
|
|
|
|
|
compare_dir = 1;
|
|
|
|
|
off_by_one = 1;
|
|
|
|
|
break;
|
|
|
|
|
case GEU:
|
|
|
|
|
unsigned_p = 1;
|
|
|
|
|
case GE:
|
|
|
|
|
compare_dir = -1;
|
|
|
|
|
off_by_one = -1;
|
|
|
|
|
break;
|
|
|
|
|
case EQ:
|
|
|
|
|
/* Cannot determine loop iterations with this case. */
|
|
|
|
|
compare_dir = 0;
|
|
|
|
|
break;
|
|
|
|
|
case LTU:
|
|
|
|
|
unsigned_p = 1;
|
|
|
|
|
case LT:
|
|
|
|
|
compare_dir = 1;
|
|
|
|
|
break;
|
|
|
|
|
case GTU:
|
|
|
|
|
unsigned_p = 1;
|
|
|
|
|
case GT:
|
|
|
|
|
compare_dir = -1;
|
|
|
|
|
case NE:
|
|
|
|
|
compare_dir = 0;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* If the comparison value is an invariant register, then try to find
|
|
|
|
|
its value from the insns before the start of the loop. */
|
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
final_value = comparison_value;
|
2000-09-12 16:43:25 +02:00
|
|
|
|
if (GET_CODE (comparison_value) == REG
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
&& loop_invariant_p (loop, comparison_value))
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
final_value = loop_find_equiv_value (loop, comparison_value);
|
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
/* If we don't get an invariant final value, we are better
|
|
|
|
|
off with the original register. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
if (! loop_invariant_p (loop, final_value))
|
1998-11-25 22:32:27 +01:00
|
|
|
|
final_value = comparison_value;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Calculate the approximate final value of the induction variable
|
|
|
|
|
(on the last successful iteration). The exact final value
|
|
|
|
|
depends on the branch operator, and increment sign. It will be
|
|
|
|
|
wrong if the iteration variable is not incremented by one each
|
|
|
|
|
time through the loop and (comparison_value + off_by_one -
|
|
|
|
|
initial_value) % increment != 0.
|
|
|
|
|
??? Note that the final_value may overflow and thus final_larger
|
|
|
|
|
will be bogus. A potentially infinite loop will be classified
|
|
|
|
|
as immediate, e.g. for (i = 0x7ffffff0; i <= 0x7fffffff; i++) */
|
|
|
|
|
if (off_by_one)
|
|
|
|
|
final_value = plus_constant (final_value, off_by_one);
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Save the calculated values describing this loop's bounds, in case
|
|
|
|
|
precondition_loop_p will need them later. These values can not be
|
|
|
|
|
recalculated inside precondition_loop_p because strength reduction
|
1999-02-04 23:55:55 +01:00
|
|
|
|
optimizations may obscure the loop's structure.
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
These values are only required by precondition_loop_p and insert_bct
|
|
|
|
|
whenever the number of iterations cannot be computed at compile time.
|
|
|
|
|
Only the difference between final_value and initial_value is
|
|
|
|
|
important. Note that final_value is only approximate. */
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->initial_value = initial_value;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->comparison_value = comparison_value;
|
|
|
|
|
loop_info->final_value = plus_constant (comparison_value, off_by_one);
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->increment = increment;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->iteration_var = iteration_var;
|
1998-11-25 22:19:21 +01:00
|
|
|
|
loop_info->comparison_code = comparison_code;
|
2000-09-11 23:44:21 +02:00
|
|
|
|
loop_info->iv = bl;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
/* Try to determine the iteration count for loops such
|
|
|
|
|
as (for i = init; i < init + const; i++). When running the
|
|
|
|
|
loop optimization twice, the first pass often converts simple
|
|
|
|
|
loops into this form. */
|
1998-11-25 22:32:27 +01:00
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
if (REG_P (initial_value))
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
1998-12-15 21:31:18 +01:00
|
|
|
|
rtx reg1;
|
|
|
|
|
rtx reg2;
|
|
|
|
|
rtx const2;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
reg1 = initial_value;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
if (GET_CODE (final_value) == PLUS)
|
1998-12-15 21:31:18 +01:00
|
|
|
|
reg2 = XEXP (final_value, 0), const2 = XEXP (final_value, 1);
|
1998-11-25 22:32:27 +01:00
|
|
|
|
else
|
1998-12-15 21:31:18 +01:00
|
|
|
|
reg2 = final_value, const2 = const0_rtx;
|
1998-11-25 22:32:27 +01:00
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
/* Check for initial_value = reg1, final_value = reg2 + const2,
|
|
|
|
|
where reg1 != reg2. */
|
|
|
|
|
if (REG_P (reg2) && reg2 != reg1)
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
1998-12-15 21:31:18 +01:00
|
|
|
|
rtx temp;
|
|
|
|
|
|
|
|
|
|
/* Find what reg1 is equivalent to. Hopefully it will
|
|
|
|
|
either be reg2 or reg2 plus a constant. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
temp = loop_find_equiv_value (loop, reg1);
|
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
if (find_common_reg_term (temp, reg2))
|
|
|
|
|
initial_value = temp;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Find what reg2 is equivalent to. Hopefully it will
|
|
|
|
|
either be reg1 or reg1 plus a constant. Let's ignore
|
|
|
|
|
the latter case for now since it is not so common. */
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
temp = loop_find_equiv_value (loop, reg2);
|
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
if (temp == loop_info->iteration_var)
|
|
|
|
|
temp = initial_value;
|
|
|
|
|
if (temp == reg1)
|
|
|
|
|
final_value = (const2 == const0_rtx)
|
|
|
|
|
? reg1 : gen_rtx_PLUS (GET_MODE (reg1), reg1, const2);
|
|
|
|
|
}
|
1998-11-25 22:32:27 +01:00
|
|
|
|
}
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
else if (loop->vtop && GET_CODE (reg2) == CONST_INT)
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
1998-12-15 21:31:18 +01:00
|
|
|
|
rtx temp;
|
|
|
|
|
|
2000-09-12 16:43:25 +02:00
|
|
|
|
/* When running the loop optimizer twice, check_dbra_loop
|
|
|
|
|
further obfuscates reversible loops of the form:
|
|
|
|
|
for (i = init; i < init + const; i++). We often end up with
|
|
|
|
|
final_value = 0, initial_value = temp, temp = temp2 - init,
|
|
|
|
|
where temp2 = init + const. If the loop has a vtop we
|
|
|
|
|
can replace initial_value with const. */
|
1998-12-15 21:31:18 +01:00
|
|
|
|
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
temp = loop_find_equiv_value (loop, reg1);
|
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
if (GET_CODE (temp) == MINUS && REG_P (XEXP (temp, 0)))
|
|
|
|
|
{
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
rtx temp2 = loop_find_equiv_value (loop, XEXP (temp, 0));
|
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
if (GET_CODE (temp2) == PLUS
|
|
|
|
|
&& XEXP (temp2, 0) == XEXP (temp, 1))
|
|
|
|
|
initial_value = XEXP (temp2, 1);
|
|
|
|
|
}
|
1998-11-25 22:32:27 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1998-12-15 21:31:18 +01:00
|
|
|
|
/* If have initial_value = reg + const1 and final_value = reg +
|
|
|
|
|
const2, then replace initial_value with const1 and final_value
|
|
|
|
|
with const2. This should be safe since we are protected by the
|
|
|
|
|
initial comparison before entering the loop if we have a vtop.
|
|
|
|
|
For example, a + b < a + c is not equivalent to b < c for all a
|
|
|
|
|
when using modulo arithmetic.
|
|
|
|
|
|
|
|
|
|
??? Without a vtop we could still perform the optimization if we check
|
|
|
|
|
the initial and final values carefully. */
|
loop.c (this_loop_info): Delete.
* loop.c (this_loop_info): Delete.
(uid_loop): Add in place of uid_loop_num. All uses updated.
(loop_number_exit_count): Delete and replace with entry in loop
structure. All uses updated.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(loop_used_count_register): Delete and replace with entry in
loop_info structure.
(find_and_verify_loops): Add loops argument.
(verify_dominator, mark_loop_jump, prescan_loop): Replace loop_start,
loop_end, etc. arguments with loop structure pointer. All callers
changed.
(loop_reg_used_before_p, scan_loop, strength_reduce): Likewise.
(check_dbra_loop, next_insn_in_loop, try_copy_prop): Likewise.
(load_mems_and_recount_loop_regs_set, load_mems): Likewise.
(insert_bct): Likewise.
(basic_induction_var): New argument level.
* loop.h (struct loop_info): Delete fields num, loops_enclosed,
vtop, and cont. Add used_count_register.
(uid_loop): Delete declaration.
(loop_number_exit_count): Likewise.
(loop_number_loop_starts, loop_number_loop_ends): Likewise.
(loop_number_loop_cont, loop_number_cont_dominator): Likewise.
(loop_outer_loop, loop_used_count_register): Likewise.
(loop_invalid, loop_number_exit_labels): Likewise.
(unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
Include basic-block.h.
* unroll.c: (unroll_loop): Replace loop_start and loop_end arguments
with loop structure pointer.
(loop_precondition_p, loop_iterations): Likewise.
* basic-block.h (struct loop): New entries vtop, cont,
cont_dominator, start, end, top, scan_start, exit_labels,
exit_count.
* Makefile.in (LOOP_H): Add basic-block.h to dependencies.
From-SVN: r31434
2000-01-15 04:01:49 +01:00
|
|
|
|
if (loop->vtop
|
1998-12-15 21:31:18 +01:00
|
|
|
|
&& (reg_term = find_common_reg_term (initial_value, final_value)))
|
|
|
|
|
{
|
|
|
|
|
initial_value = subtract_reg_term (initial_value, reg_term);
|
|
|
|
|
final_value = subtract_reg_term (final_value, reg_term);
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
loop_info->initial_equiv_value = initial_value;
|
|
|
|
|
loop_info->final_equiv_value = final_value;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1999-03-12 13:46:36 +01:00
|
|
|
|
/* For EQ comparison loops, we don't have a valid final value.
|
|
|
|
|
Check this now so that we won't leave an invalid value if we
|
|
|
|
|
return early for any other reason. */
|
|
|
|
|
if (comparison_code == EQ)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
loop_info->final_equiv_value = loop_info->final_value = 0;
|
1999-03-12 13:46:36 +01:00
|
|
|
|
|
1994-10-20 21:33:42 +01:00
|
|
|
|
if (increment == 0)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream,
|
1998-11-25 22:32:27 +01:00
|
|
|
|
"Loop iterations: Increment value can't be calculated.\n");
|
1994-10-20 21:33:42 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
1998-11-25 22:32:27 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (increment) != CONST_INT)
|
1994-10-20 21:33:42 +01:00
|
|
|
|
{
|
1999-03-08 17:09:05 +01:00
|
|
|
|
/* If we have a REG, check to see if REG holds a constant value. */
|
|
|
|
|
/* ??? Other RTL, such as (neg (reg)) is possible here, but it isn't
|
|
|
|
|
clear if it is worthwhile to try to handle such RTL. */
|
|
|
|
|
if (GET_CODE (increment) == REG || GET_CODE (increment) == SUBREG)
|
loop.c (current_loop_info): Delete.
2000-01-26 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* loop.c (current_loop_info): Delete.
(consec_sets_invariant_p): Add loop argument, update callers.
(get_condition_for_loop): Likewise.
(count_nonfixed_reads, update_giv_derive): Likewise.
(simplify_giv_expr, general_induction_var): Likewise.
(consec_sets_giv, recombine_givs): Likewise.
(move_movables): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_mem_givs, check_final_value): Likewise.
(record_giv, maybe_eliminate_biv, maybe_eliminate_biv_1): Likewise.
(loop_invariant_p): Rename from invariant_p, add loop argument, and
update callers.
(basic_induction_var): Add loop argument, delete loop_level argument,
and update callers.
* unroll.c (iteration_info): Delete loop_start and loop_end arguments,
add loop argument, and update callers.
(find_splittable_regs, find_splittable_givs): Likewise.
(reg_dead_after_loop, loop_find_equiv_value): Likewise.
(final_biv_value, final_giv_value, back_branch_in_range_p): Likewise.
(biv_total_increment): Delete loop_start and loop_end arguments;
update callers.
(precondition_loop_p): Delete loop_start and loop_info arguments;
update callers.
* loop.h (get_condition_for_loop): Add loop argument.
(biv_total_increment): Delete loop_start and loop_end arguments.
(precondition_loop_p): Delete loop_start and loop_info arguments;
add loop argument.
(final_biv_value): Delete loop_start and loop_end arguments;
add loop argument.
(final_giv_value, back_branch_in_range_p): Likewise.
From-SVN: r31618
2000-01-25 23:49:56 +01:00
|
|
|
|
increment = loop_find_equiv_value (loop, increment);
|
1998-11-25 22:32:27 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (increment) != CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
{
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Increment value not constant ");
|
2001-01-06 04:24:58 +01:00
|
|
|
|
print_simple_rtl (loop_dump_stream, increment);
|
1998-11-25 22:32:27 +01:00
|
|
|
|
fprintf (loop_dump_stream, ".\n");
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
loop_info->increment = increment;
|
1994-10-20 21:33:42 +01:00
|
|
|
|
}
|
1998-11-25 22:32:27 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (initial_value) != CONST_INT)
|
1994-10-20 21:33:42 +01:00
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Initial value not constant ");
|
2001-01-06 04:24:58 +01:00
|
|
|
|
print_simple_rtl (loop_dump_stream, initial_value);
|
1998-11-25 22:32:27 +01:00
|
|
|
|
fprintf (loop_dump_stream, ".\n");
|
|
|
|
|
}
|
1994-10-20 21:33:42 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else if (GET_CODE (final_value) != CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
1998-11-25 22:32:27 +01:00
|
|
|
|
{
|
|
|
|
|
fprintf (loop_dump_stream,
|
|
|
|
|
"Loop iterations: Final value not constant ");
|
2001-01-06 04:24:58 +01:00
|
|
|
|
print_simple_rtl (loop_dump_stream, final_value);
|
1998-11-25 22:32:27 +01:00
|
|
|
|
fprintf (loop_dump_stream, ".\n");
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
2002-06-30 07:06:01 +02:00
|
|
|
|
else if (comparison_code == EQ)
|
|
|
|
|
{
|
|
|
|
|
rtx inc_once;
|
|
|
|
|
|
|
|
|
|
if (loop_dump_stream)
|
|
|
|
|
fprintf (loop_dump_stream, "Loop iterations: EQ comparison loop.\n");
|
|
|
|
|
|
|
|
|
|
inc_once = gen_int_mode (INTVAL (initial_value) + INTVAL (increment),
|
|
|
|
|
GET_MODE (iteration_var));
|
|
|
|
|
|
|
|
|
|
if (inc_once == final_value)
|
|
|
|
|
{
|
|
|
|
|
/* The iterator value once through the loop is equal to the
|
2002-12-24 09:30:34 +01:00
|
|
|
|
comparison value. Either we have an infinite loop, or
|
2002-06-30 07:06:01 +02:00
|
|
|
|
we'll loop twice. */
|
|
|
|
|
if (increment == const0_rtx)
|
|
|
|
|
return 0;
|
|
|
|
|
loop_info->n_iterations = 2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
loop_info->n_iterations = 1;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (loop_info->initial_value) == CONST_INT)
|
|
|
|
|
loop_info->final_value
|
|
|
|
|
= gen_int_mode ((INTVAL (loop_info->initial_value)
|
|
|
|
|
+ loop_info->n_iterations * INTVAL (increment)),
|
|
|
|
|
GET_MODE (iteration_var));
|
|
|
|
|
else
|
|
|
|
|
loop_info->final_value
|
|
|
|
|
= plus_constant (loop_info->initial_value,
|
|
|
|
|
loop_info->n_iterations * INTVAL (increment));
|
|
|
|
|
loop_info->final_equiv_value
|
|
|
|
|
= gen_int_mode ((INTVAL (initial_value)
|
|
|
|
|
+ loop_info->n_iterations * INTVAL (increment)),
|
|
|
|
|
GET_MODE (iteration_var));
|
|
|
|
|
return loop_info->n_iterations;
|
|
|
|
|
}
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
/* Final_larger is 1 if final larger, 0 if they are equal, otherwise -1. */
|
1998-11-25 22:32:27 +01:00
|
|
|
|
if (unsigned_p)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
final_larger
|
1992-07-06 22:15:06 +02:00
|
|
|
|
= ((unsigned HOST_WIDE_INT) INTVAL (final_value)
|
|
|
|
|
> (unsigned HOST_WIDE_INT) INTVAL (initial_value))
|
|
|
|
|
- ((unsigned HOST_WIDE_INT) INTVAL (final_value)
|
|
|
|
|
< (unsigned HOST_WIDE_INT) INTVAL (initial_value));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
else
|
1992-07-06 22:15:06 +02:00
|
|
|
|
final_larger = (INTVAL (final_value) > INTVAL (initial_value))
|
|
|
|
|
- (INTVAL (final_value) < INTVAL (initial_value));
|
1992-02-08 04:27:38 +01:00
|
|
|
|
|
|
|
|
|
if (INTVAL (increment) > 0)
|
|
|
|
|
increment_dir = 1;
|
|
|
|
|
else if (INTVAL (increment) == 0)
|
|
|
|
|
increment_dir = 0;
|
|
|
|
|
else
|
|
|
|
|
increment_dir = -1;
|
|
|
|
|
|
|
|
|
|
/* There are 27 different cases: compare_dir = -1, 0, 1;
|
|
|
|
|
final_larger = -1, 0, 1; increment_dir = -1, 0, 1.
|
|
|
|
|
There are 4 normal cases, 4 reverse cases (where the iteration variable
|
|
|
|
|
will overflow before the loop exits), 4 infinite loop cases, and 15
|
|
|
|
|
immediate exit (0 or 1 iteration depending on loop type) cases.
|
|
|
|
|
Only try to optimize the normal cases. */
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1992-02-08 04:27:38 +01:00
|
|
|
|
/* (compare_dir/final_larger/increment_dir)
|
|
|
|
|
Normal cases: (0/-1/-1), (0/1/1), (-1/-1/-1), (1/1/1)
|
|
|
|
|
Reverse cases: (0/-1/1), (0/1/-1), (-1/-1/1), (1/1/-1)
|
|
|
|
|
Infinite loops: (0/-1/0), (0/1/0), (-1/-1/0), (1/1/0)
|
|
|
|
|
Immediate exit: (0/0/X), (-1/0/X), (-1/1/X), (1/0/X), (1/-1/X) */
|
|
|
|
|
|
|
|
|
|
/* ?? If the meaning of reverse loops (where the iteration variable
|
|
|
|
|
will overflow before the loop exits) is undefined, then could
|
|
|
|
|
eliminate all of these special checks, and just always assume
|
|
|
|
|
the loops are normal/immediate/infinite. Note that this means
|
|
|
|
|
the sign of increment_dir does not have to be known. Also,
|
|
|
|
|
since it does not really hurt if immediate exit loops or infinite loops
|
|
|
|
|
are optimized, then that case could be ignored also, and hence all
|
|
|
|
|
loops can be optimized.
|
|
|
|
|
|
|
|
|
|
According to ANSI Spec, the reverse loop case result is undefined,
|
|
|
|
|
because the action on overflow is undefined.
|
|
|
|
|
|
|
|
|
|
See also the special test for NE loops below. */
|
|
|
|
|
|
|
|
|
|
if (final_larger == increment_dir && final_larger != 0
|
|
|
|
|
&& (final_larger == compare_dir || compare_dir == 0))
|
|
|
|
|
/* Normal case. */
|
|
|
|
|
;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (loop_dump_stream)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
fprintf (loop_dump_stream, "Loop iterations: Not normal loop.\n");
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Calculate the number of iterations, final_value is only an approximation,
|
1998-11-25 22:32:27 +01:00
|
|
|
|
so correct for that. Note that abs_diff and n_iterations are
|
1992-02-08 04:27:38 +01:00
|
|
|
|
unsigned, because they can be as large as 2^n - 1. */
|
|
|
|
|
|
2001-05-06 21:51:19 +02:00
|
|
|
|
inc = INTVAL (increment);
|
|
|
|
|
if (inc > 0)
|
|
|
|
|
{
|
|
|
|
|
abs_diff = INTVAL (final_value) - INTVAL (initial_value);
|
|
|
|
|
abs_inc = inc;
|
|
|
|
|
}
|
|
|
|
|
else if (inc < 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
{
|
1998-11-25 22:32:27 +01:00
|
|
|
|
abs_diff = INTVAL (initial_value) - INTVAL (final_value);
|
2001-05-06 21:51:19 +02:00
|
|
|
|
abs_inc = -inc;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
|
2001-05-06 21:51:19 +02:00
|
|
|
|
/* Given that iteration_var is going to iterate over its own mode,
|
|
|
|
|
not HOST_WIDE_INT, disregard higher bits that might have come
|
|
|
|
|
into the picture due to sign extension of initial and final
|
|
|
|
|
values. */
|
2002-01-10 21:12:57 +01:00
|
|
|
|
abs_diff &= ((unsigned HOST_WIDE_INT) 1
|
2001-05-06 21:51:19 +02:00
|
|
|
|
<< (GET_MODE_BITSIZE (GET_MODE (iteration_var)) - 1)
|
|
|
|
|
<< 1) - 1;
|
2001-04-12 05:41:36 +02:00
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
/* For NE tests, make sure that the iteration variable won't miss
|
|
|
|
|
the final value. If abs_diff mod abs_incr is not zero, then the
|
|
|
|
|
iteration variable will overflow before the loop exits, and we
|
|
|
|
|
can not calculate the number of iterations. */
|
|
|
|
|
if (compare_dir == 0 && (abs_diff % abs_inc) != 0)
|
1992-02-08 04:27:38 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
1998-11-25 22:32:27 +01:00
|
|
|
|
/* Note that the number of iterations could be calculated using
|
|
|
|
|
(abs_diff + abs_inc - 1) / abs_inc, provided care was taken to
|
|
|
|
|
handle potential overflow of the summation. */
|
|
|
|
|
loop_info->n_iterations = abs_diff / abs_inc + ((abs_diff % abs_inc) != 0);
|
|
|
|
|
return loop_info->n_iterations;
|
1992-02-08 04:27:38 +01:00
|
|
|
|
}
|
1994-05-02 22:42:23 +02:00
|
|
|
|
|
1995-05-16 14:39:54 +02:00
|
|
|
|
/* Replace uses of split bivs with their split pseudo register. This is
|
1994-05-02 22:42:23 +02:00
|
|
|
|
for original instructions which remain after loop unrolling without
|
|
|
|
|
copying. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
2000-09-11 23:48:46 +02:00
|
|
|
|
remap_split_bivs (loop, x)
|
|
|
|
|
struct loop *loop;
|
1994-05-02 22:42:23 +02:00
|
|
|
|
rtx x;
|
|
|
|
|
{
|
2000-09-11 23:48:46 +02:00
|
|
|
|
struct loop_ivs *ivs = LOOP_IVS (loop);
|
2001-10-11 05:16:15 +02:00
|
|
|
|
enum rtx_code code;
|
|
|
|
|
int i;
|
|
|
|
|
const char *fmt;
|
1994-05-02 22:42:23 +02:00
|
|
|
|
|
|
|
|
|
if (x == 0)
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case SCRATCH:
|
|
|
|
|
case PC:
|
|
|
|
|
case CC0:
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
case CONST_DOUBLE:
|
|
|
|
|
case CONST:
|
|
|
|
|
case SYMBOL_REF:
|
|
|
|
|
case LABEL_REF:
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
case REG:
|
|
|
|
|
#if 0
|
|
|
|
|
/* If non-reduced/final-value givs were split, then this would also
|
|
|
|
|
have to remap those givs also. */
|
|
|
|
|
#endif
|
2001-01-01 02:04:01 +01:00
|
|
|
|
if (REGNO (x) < ivs->n_regs
|
2000-09-11 23:48:46 +02:00
|
|
|
|
&& REG_IV_TYPE (ivs, REGNO (x)) == BASIC_INDUCT)
|
2001-01-01 01:37:09 +01:00
|
|
|
|
return REG_IV_CLASS (ivs, REGNO (x))->biv->src_reg;
|
1997-11-02 22:19:36 +01:00
|
|
|
|
break;
|
1999-02-04 23:55:55 +01:00
|
|
|
|
|
1997-11-02 22:19:36 +01:00
|
|
|
|
default:
|
|
|
|
|
break;
|
1994-05-02 22:42:23 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
if (fmt[i] == 'e')
|
2000-09-11 23:48:46 +02:00
|
|
|
|
XEXP (x, i) = remap_split_bivs (loop, XEXP (x, i));
|
1999-12-28 00:01:12 +01:00
|
|
|
|
else if (fmt[i] == 'E')
|
1994-05-02 22:42:23 +02:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int j;
|
1994-05-02 22:42:23 +02:00
|
|
|
|
for (j = 0; j < XVECLEN (x, i); j++)
|
2000-09-11 23:48:46 +02:00
|
|
|
|
XVECEXP (x, i, j) = remap_split_bivs (loop, XVECEXP (x, i, j));
|
1994-05-02 22:42:23 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
}
|
1996-10-08 23:51:09 +02:00
|
|
|
|
|
|
|
|
|
/* If FIRST_UID is a set of REGNO, and FIRST_UID dominates LAST_UID (e.g.
|
|
|
|
|
FIST_UID is always executed if LAST_UID is), then return 1. Otherwise
|
|
|
|
|
return 0. COPY_START is where we can start looking for the insns
|
|
|
|
|
FIRST_UID and LAST_UID. COPY_END is where we stop looking for these
|
|
|
|
|
insns.
|
|
|
|
|
|
|
|
|
|
If there is no JUMP_INSN between LOOP_START and FIRST_UID, then FIRST_UID
|
|
|
|
|
must dominate LAST_UID.
|
|
|
|
|
|
|
|
|
|
If there is a CODE_LABEL between FIRST_UID and LAST_UID, then FIRST_UID
|
|
|
|
|
may not dominate LAST_UID.
|
|
|
|
|
|
|
|
|
|
If there is no CODE_LABEL between FIRST_UID and LAST_UID, then FIRST_UID
|
|
|
|
|
must dominate LAST_UID. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
set_dominates_use (regno, first_uid, last_uid, copy_start, copy_end)
|
|
|
|
|
int regno;
|
|
|
|
|
int first_uid;
|
|
|
|
|
int last_uid;
|
|
|
|
|
rtx copy_start;
|
|
|
|
|
rtx copy_end;
|
|
|
|
|
{
|
|
|
|
|
int passed_jump = 0;
|
|
|
|
|
rtx p = NEXT_INSN (copy_start);
|
|
|
|
|
|
|
|
|
|
while (INSN_UID (p) != first_uid)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (p) == JUMP_INSN)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
passed_jump = 1;
|
1996-10-08 23:51:09 +02:00
|
|
|
|
/* Could not find FIRST_UID. */
|
|
|
|
|
if (p == copy_end)
|
|
|
|
|
return 0;
|
|
|
|
|
p = NEXT_INSN (p);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Verify that FIRST_UID is an insn that entirely sets REGNO. */
|
2000-08-04 22:28:08 +02:00
|
|
|
|
if (! INSN_P (p) || ! dead_or_set_regno_p (p, regno))
|
1996-10-08 23:51:09 +02:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* FIRST_UID is always executed. */
|
|
|
|
|
if (passed_jump == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
while (INSN_UID (p) != last_uid)
|
|
|
|
|
{
|
|
|
|
|
/* If we see a CODE_LABEL between FIRST_UID and LAST_UID, then we
|
|
|
|
|
can not be sure that FIRST_UID dominates LAST_UID. */
|
|
|
|
|
if (GET_CODE (p) == CODE_LABEL)
|
|
|
|
|
return 0;
|
1997-05-01 01:53:13 +02:00
|
|
|
|
/* Could not find LAST_UID, but we reached the end of the loop, so
|
|
|
|
|
it must be safe. */
|
|
|
|
|
else if (p == copy_end)
|
|
|
|
|
return 1;
|
1996-10-08 23:51:09 +02:00
|
|
|
|
p = NEXT_INSN (p);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* FIRST_UID is always executed if LAST_UID is executed. */
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2000-09-07 15:10:51 +02:00
|
|
|
|
|
|
|
|
|
/* This routine is called when the number of iterations for the unrolled
|
|
|
|
|
loop is one. The goal is to identify a loop that begins with an
|
|
|
|
|
unconditional branch to the loop continuation note (or a label just after).
|
|
|
|
|
In this case, the unconditional branch that starts the loop needs to be
|
|
|
|
|
deleted so that we execute the single iteration. */
|
2000-09-12 16:43:25 +02:00
|
|
|
|
|
2000-09-07 15:10:51 +02:00
|
|
|
|
static rtx
|
|
|
|
|
ujump_to_loop_cont (loop_start, loop_cont)
|
2000-09-12 16:43:25 +02:00
|
|
|
|
rtx loop_start;
|
|
|
|
|
rtx loop_cont;
|
2000-09-07 15:10:51 +02:00
|
|
|
|
{
|
|
|
|
|
rtx x, label, label_ref;
|
|
|
|
|
|
|
|
|
|
/* See if loop start, or the next insn is an unconditional jump. */
|
|
|
|
|
loop_start = next_nonnote_insn (loop_start);
|
|
|
|
|
|
|
|
|
|
x = pc_set (loop_start);
|
|
|
|
|
if (!x)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
|
|
|
|
label_ref = SET_SRC (x);
|
|
|
|
|
if (!label_ref)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
|
|
|
|
/* Examine insn after loop continuation note. Return if not a label. */
|
|
|
|
|
label = next_nonnote_insn (loop_cont);
|
|
|
|
|
if (label == 0 || GET_CODE (label) != CODE_LABEL)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
|
|
|
|
|
/* Return the loop start if the branch label matches the code label. */
|
2000-09-12 16:43:25 +02:00
|
|
|
|
if (CODE_LABEL_NUMBER (label) == CODE_LABEL_NUMBER (XEXP (label_ref, 0)))
|
2000-09-07 15:10:51 +02:00
|
|
|
|
return loop_start;
|
|
|
|
|
else
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|