Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
/* Inlining decision heuristics.
|
2011-03-11 11:04:30 +01:00
|
|
|
Copyright (C) 2003, 2004, 2007, 2008, 2009, 2010, 2011
|
Make-lang.in, [...]: Update copyright years.
* ada/gcc-interface/Make-lang.in, alias.c, attribs.c, auto-inc-dec.c,
basic-block.h, bb-reorder.c, calls.c, c-common.c, cgraph.h,
collect2.h, config/alpha/alpha.c, config/alpha/alpha.md,
config/alpha/predicates.md, config/arm/arm.md,
config/arm/lib1funcs.asm, config/arm/neon-schedgen.ml,
config/avr/avr.c, config/avr/avr.md, config/bfin/bfin.c,
config/darwin9.h, config/darwin.c, config/darwin.h,
config/h8300/h8300.c, config/i386/cpuid.h, config/i386/cygming.h,
config/i386/cygwin.h, config/i386/mingw32.h, config/i386/msformat-c.c,
config/i386/sol2-10.h, config/i386/xopintrin.h, config/ia64/ia64.c,
config/ia64/ia64.md, config/ia64/sync.md, config/mep/mep.c,
config/mips/mips.md, config/mn10300/mn10300.c,
config/mn10300/mn10300.h, config/pa/pa.c, config/pa/pa.md,
config/rs6000/aix.h, config/rs6000/dfp.md,
config/rs6000/rs6000-builtin.def, config/rs6000/rs6000-c.c,
config/rs6000/vector.md, config/rtems.h, config/rx/rx.md,
config/s390/s390.md, config/sol2-c.c, config/sparc/sol2-bi.h,
config/sparc/sol2-gas.h, config/sparc/sparc.h, config/sparc/sparc.md,
config/sparc/sparc-protos.h, config/spu/spu.c, config/spu/spu-c.c,
config/t-darwin, convert.c, c.opt, c-opts.c, cp/Make-lang.in,
c-pretty-print.c, c-typeck.c, df-core.c, df-scan.c, diagnostic.c,
diagnostic.h, doc/cppopts.texi, doc/cpp.texi, doc/extend.texi,
doc/gimple.texi, doc/languages.texi, doc/plugins.texi, doc/rtl.texi,
doc/standards.texi, doc/tree-ssa.texi, doc/trouble.texi, dominance.c,
fold-const.c, fortran/Make-lang.in, fwprop.c, gcc-plugin.h,
gensupport.c, gimple.h, gimple-iterator.c, graphite.c,
graphite-clast-to-gimple.c, graphite-clast-to-gimple.h,
graphite-dependences.c, graphite-poly.c, graphite-poly.h,
graphite-ppl.c, graphite-ppl.h, graphite-scop-detection.c,
graphite-sese-to-poly.c, graphite-sese-to-poly.h, ifcvt.c, intl.c,
intl.h, ipa.c, ipa-cp.c, ipa-inline.c, ipa-prop.c, ipa-prop.h,
ipa-pure-const.c, ipa-reference.c, ipa-type-escape.c, ira-color.c,
ira-conflicts.c, ira-lives.c, java/Make-lang.in, lambda-code.c,
loop-invariant.c, lto/Make-lang.in, lto-streamer.h, lto-streamer-in.c,
objc/Make-lang.in, objcp/Make-lang.in, omp-low.c, optc-gen.awk,
opt-functions.awk, opth-gen.awk, params.def, passes.c,
postreload-gcse.c, print-tree.c, recog.c, regrename.c, reload.h,
rtl.def, sched-int.h, sched-rgn.c, sel-sched-dump.c, sese.c, sese.h,
store-motion.c, stor-layout.c, tree-cfgcleanup.c, tree-chrec.c,
tree-complex.c, tree-data-ref.c, tree.def, tree-eh.c, tree-flow.h,
tree-flow-inline.h, tree.h, tree-loop-distribution.c, tree-outof-ssa.c,
tree-parloops.c, tree-pass.h, tree-predcom.c, tree-profile.c,
tree-scalar-evolution.c, tree-ssa-address.c, tree-ssa-alias.c,
tree-ssa-coalesce.c, tree-ssa-copy.c, tree-ssa-dce.c, tree-ssa-dom.c,
tree-ssa-dse.c, tree-ssa-loop-im.c, tree-ssa-loop-ivcanon.c,
tree-ssa-loop-manip.c, tree-ssa-math-opts.c, tree-ssa-operands.c,
tree-ssa-pre.c, tree-ssa-sccvn.c, tree-ssa-structalias.c,
tree-ssa-uncprop.c, tree-tailcall.c, tree-vect-data-refs.c,
tree-vect-loop.c, tree-vectorizer.h, tree-vect-slp.c, tree-vrp.c,
unwind-dw2-fde-darwin.c, varpool.c: Update copyright years.
From-SVN: r157950
2010-04-02 21:54:46 +02:00
|
|
|
Free Software Foundation, Inc.
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
Contributed by Jan Hubicka
|
|
|
|
|
|
|
|
This file is part of GCC.
|
|
|
|
|
|
|
|
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
|
2007-07-26 10:37:01 +02:00
|
|
|
Software Foundation; either version 3, or (at your option) any later
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
version.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2007-07-26 10:37:01 +02:00
|
|
|
along with GCC; see the file COPYING3. If not see
|
|
|
|
<http://www.gnu.org/licenses/>. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
/* Inlining decision heuristics
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
The implementation of inliner is organized as follows:
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
inlining heuristics limits
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
can_inline_edge_p allow to check that particular inlining is allowed
|
|
|
|
by the limits specified by user (allowed function growth, growth and so
|
|
|
|
on).
|
|
|
|
|
|
|
|
Functions are inlined when it is obvious the result is profitable (such
|
|
|
|
as functions called once or when inlining reduce code size).
|
|
|
|
In addition to that we perform inlining of small functions and recursive
|
|
|
|
inlining.
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
inlining heuristics
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
The inliner itself is split into two passes:
|
|
|
|
|
|
|
|
pass_early_inlining
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
Simple local inlining pass inlining callees into current function.
|
|
|
|
This pass makes no use of whole unit analysis and thus it can do only
|
|
|
|
very simple decisions based on local properties.
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
The strength of the pass is that it is run in topological order
|
|
|
|
(reverse postorder) on the callgraph. Functions are converted into SSA
|
|
|
|
form just before this pass and optimized subsequently. As a result, the
|
|
|
|
callees of the function seen by the early inliner was already optimized
|
2011-04-18 20:39:39 +02:00
|
|
|
and results of early inlining adds a lot of optimization opportunities
|
2011-04-17 16:22:20 +02:00
|
|
|
for the local optimization.
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
The pass handle the obvious inlining decisions within the compilation
|
2011-04-17 16:22:20 +02:00
|
|
|
unit - inlining auto inline functions, inlining for size and
|
|
|
|
flattening.
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
main strength of the pass is the ability to eliminate abstraction
|
|
|
|
penalty in C++ code (via combination of inlining and early
|
|
|
|
optimization) and thus improve quality of analysis done by real IPA
|
|
|
|
optimizers.
|
2007-01-16 22:30:54 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
Because of lack of whole unit knowledge, the pass can not really make
|
|
|
|
good code size/performance tradeoffs. It however does very simple
|
|
|
|
speculative inlining allowing code size to grow by
|
2011-04-18 20:39:39 +02:00
|
|
|
EARLY_INLINING_INSNS when callee is leaf function. In this case the
|
|
|
|
optimizations performed later are very likely to eliminate the cost.
|
2007-01-16 22:30:54 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
pass_ipa_inline
|
2007-01-16 22:30:54 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
This is the real inliner able to handle inlining with whole program
|
|
|
|
knowledge. It performs following steps:
|
2007-01-16 22:30:54 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
1) inlining of small functions. This is implemented by greedy
|
|
|
|
algorithm ordering all inlinable cgraph edges by their badness and
|
|
|
|
inlining them in this order as long as inline limits allows doing so.
|
2007-01-16 22:30:54 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
This heuristics is not very good on inlining recursive calls. Recursive
|
|
|
|
calls can be inlined with results similar to loop unrolling. To do so,
|
|
|
|
special purpose recursive inliner is executed on function when
|
|
|
|
recursive edge is met as viable candidate.
|
2007-01-16 22:30:54 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
2) Unreachable functions are removed from callgraph. Inlining leads
|
|
|
|
to devirtualization and other modification of callgraph so functions
|
|
|
|
may become unreachable during the process. Also functions declared as
|
|
|
|
extern inline or virtual functions are removed, since after inlining
|
|
|
|
we no longer need the offline bodies.
|
|
|
|
|
|
|
|
3) Functions called once and not exported from the unit are inlined.
|
|
|
|
This should almost always lead to reduction of code size by eliminating
|
|
|
|
the need for offline copy of the function. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "coretypes.h"
|
|
|
|
#include "tm.h"
|
|
|
|
#include "tree.h"
|
|
|
|
#include "tree-inline.h"
|
|
|
|
#include "langhooks.h"
|
|
|
|
#include "flags.h"
|
|
|
|
#include "cgraph.h"
|
|
|
|
#include "diagnostic.h"
|
diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or langhooks-def.h.
* diagnostic.c: Don't include tm.h, tree.h, tm_p.h, langhooks.h or
langhooks-def.h.
(diagnostic_initialize): Initialize x_data not last_function.
(diagnostic_report_current_function): Move to tree-diagnostic.c.
(default_diagnostic_starter): Call
diagnostic_report_current_module not
diagnostic_report_current_function.
(diagnostic_report_diagnostic): Initialize x_data not
abstract_origin.
(verbatim): Likewise.
* diagnostic.h (struct diagnostic_info): Change abstract_origin to
x_data.
(struct diagnostic_context): Change last_function to x_data.
(diagnostic_auxiliary_data): Replace with
diagnostic_context_auxiliary_data and
diagnostic_info_auxiliary_data.
(diagnostic_last_function_changed, diagnostic_set_last_function,
diagnostic_report_current_function): Move to tree-diagnostic.h.
(print_declaration, dump_generic_node, print_generic_stmt,
print_generic_stmt_indented, print_generic_expr,
print_generic_decl, debug_c_tree, dump_omp_clauses,
print_call_name, debug_generic_expr, debug_generic_stmt,
debug_tree_chain, default_tree_printer): Move to
tree-pretty-print.h.
(debug_gimple_stmt, debug_gimple_seq, print_gimple_seq,
print_gimple_stmt, print_gimple_expr, dump_gimple_stmt): Move to
gimple-pretty-print.h.
* pretty-print.c: Don't include tree.h
(pp_base_format): Don't handle %K here.
(pp_base_tree_identifier): Move to tree-pretty-print.c.
* pretty-print.h (text_info): Change abstract_origin to x_data.
(pp_tree_identifier, pp_unsupported_tree,
pp_base_tree_identifier): Move to tree-pretty-print.h.
* gimple-pretty-print.h, tree-diagnostic.c, tree-diagnostic.h,
tree-pretty-print.h: New files.
* tree-pretty-print.c: Include tree-pretty-print.h.
(percent_K_format): New. Moved from pretty-print.c.
(pp_base_tree_identifier): Move from pretty-print.c.
* c-objc-common.c: Include tree-pretty-print.h.
(c_tree_printer): Handle %K here.
* langhooks.c: Include tree-diagnostic.h.
(lhd_print_error_function): Use diagnostic_abstract_origin macro.
* toplev.c: Include tree-diagnostic.h and tree-pretty-print.h.
(default_tree_printer): Handle %K using percent_K_format.
(general_init): Use default_tree_diagnostic_starter.
* tree.c: Include tree-diagnostic.h and tree-pretty-print.h.
(free_lang_data): Use default_tree_diagnostic_starter.
* c-pretty-print.c: Include tree-pretty-print.h.
* cfgexpand.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* cgraphunit.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* dwarf2out.c: Include tree-pretty-print.h.
* except.c: Include tree-pretty-print.h.
* gimple-pretty-print.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* gimplify.c: Include tree-pretty-print.h.
* graphite-poly.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* ipa-cp.c: Include tree-pretty-print.h.
* ipa-inline.c: Include gimple-pretty-print.h.
* ipa-prop.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* ipa-pure-const.c: Include gimple-pretty-print.h.
* ipa-struct-reorg.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* ipa-type-escape.c: Include tree-pretty-print.h.
* print-rtl.c: Include tree-pretty-print.h.
* print-tree.c: Include gimple-pretty-print.h.
* sese.c: Include tree-pretty-print.h.
* tree-affine.c: Include tree-pretty-print.h.
* tree-browser.c: Include tree-pretty-print.h.
* tree-call-cdce.c: Include gimple-pretty-print.h.
* tree-cfg.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-chrec.c: Include tree-pretty-print.h.
* tree-data-ref.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-dfa.c: Include tree-pretty-print.h.
* tree-if-conv.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-inline.c: Include tree-pretty-print.h.
* tree-into-ssa.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-nrv.c: Include tree-pretty-print.h.
* tree-object-size.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-outof-ssa.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-parloops.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-predcom.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-scalar-evolution.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-sra.c: Include tree-pretty-print.h.
* tree-ssa-address.c: Include tree-pretty-print.h.
* tree-ssa-alias.c: Include tree-pretty-print.h.
* tree-ssa-ccp.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-coalesce.c: Include tree-pretty-print.h.
* tree-ssa-copy.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-copyrename.c: Include tree-pretty-print.h.
* tree-ssa-dce.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-dom.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-dse.c: Include gimple-pretty-print.h.
* tree-ssa-forwprop.c: Include tree-pretty-print.h.
* tree-ssa-ifcombine.c: Include tree-pretty-print.h.
* tree-ssa-live.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-im.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-ivcanon.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-ivopts.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-niter.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-loop-prefetch.c: Include tree-pretty-print.h.
* tree-ssa-math-opts.c: Include gimple-pretty-print.h.
* tree-ssa-operands.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-phiprop.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-pre.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-propagate.c: Include gimple-pretty-print.h.
* tree-ssa-reassoc.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-sccvn.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-sink.c: Include gimple-pretty-print.h.
* tree-ssa-ter.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-ssa-uninit.c: Include gimple-pretty-print.h.
* tree-ssa.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-stdarg.c: Include gimple-pretty-print.h.
* tree-switch-conversion.c: Include gimple-pretty-print.h.
* tree-tailcall.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-data-refs.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-loop-manip.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-loop.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-patterns.c: Include gimple-pretty-print.h.
* tree-vect-slp.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vect-stmts.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* tree-vectorizer.c: Include tree-pretty-print.h.
* tree-vrp.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* value-prof.c: Include tree-pretty-print.h and
gimple-pretty-print.h.
* var-tracking.c: Include tree-pretty-print.h.
* Makefile.in (OBJS-common): Add tree-diagnostic.o.
(tree-diagnostic.o): New dependencies.
(c-objc-common.o, c-pretty-print.o, langhooks.o, tree.o,
tree-inline.o, print-tree.o, stor-layout.o, tree-ssa-uninit.o,
tree-ssa.o, tree-into-ssa.o, tree-ssa-ter.o, tree-ssa-coalesce.o,
tree-outof-ssa.o, tree-ssa-forwprop.o, tree-ssa-phiprop.o,
tree-ssa-ifcombine.o, tree-nrv.o, tree-ssa-copy.o,
tree-ssa-propagate.o, tree-ssa-dom.o, tree-ssa-uncprop.o,
tree-ssa-live.o, tree-ssa-copyrename.o, tree-ssa-pre.o,
tree-ssa-sccvn.o, tree-vrp.o, tree-cfg.o, tree-tailcall.o,
tree-ssa-sink.o, tree-if-conv.o, tree-dfa.o, tree-ssa-operands.o,
tree-ssa-address.o, tree-ssa-loop-niter.o,
tree-ssa-loop-ivcanon.o, tree-ssa-loop-prefetch.o, tree-predcom.o,
tree-ssa-loop-ivopts.o, tree-affine.o, tree-ssa-loop-im.o,
tree-ssa-math-opts.o, tree-ssa-alias.o, tree-ssa-reassoc.o,
gimplify.o, tree-browser.o, tree-chrec.o, tree-scalar-evolution.o,
tree-data-ref.o, sese.o, graphite-poly.o, tree-vect-loop.o,
tree-vect-loop-manip.o, tree-vect-patterns.o, tree-vect-slp.o,
tree-vect-stmts.o, tree-vect-data-refs.o, tree-vectorizer.o,
tree-parloops.o, tree-stdarg.o, tree-object-size.o,
gimple-pretty-print.o, tree-pretty-print.o, diagnostic.o,
toplev.o, print-rtl.o, except.o, dwarf2out.o, cgraphunit.o,
ipa-prop.o, ipa-cp.o, ipa-inline.o, ipa-pure-const.o,
ipa-type-escape.o, ipa-struct-reorg.o, tree-ssa-dce.o,
tree-call-cdce.o, tree-ssa-ccp.o, tree-sra.o,
tree-switch-conversion.o, var-tracking.o, value-prof.o,
cfgexpand.o, pretty-print.o): Update dependencies.
cp:
* error.c: Include tree-diagnostic.h and tree-pretty-print.h.
(cp_print_error_function): Use diagnostic_abstract_origin macro.
(cp_printer): Handle %K here using percent_K_format.
* cxx-pretty-print.c: Include tree-pretty-print.h.
* Make-lang.in (cp/error.o, cp/cxx-pretty-print.o): Update
dependencies.
From-SVN: r159685
2010-05-22 00:34:26 +02:00
|
|
|
#include "gimple-pretty-print.h"
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
#include "params.h"
|
|
|
|
#include "fibheap.h"
|
|
|
|
#include "intl.h"
|
|
|
|
#include "tree-pass.h"
|
2005-05-25 14:34:01 +02:00
|
|
|
#include "coverage.h"
|
2005-06-28 04:20:29 +02:00
|
|
|
#include "ggc.h"
|
2007-02-09 23:49:30 +01:00
|
|
|
#include "rtl.h"
|
2011-04-17 16:22:20 +02:00
|
|
|
#include "tree-flow.h"
|
2008-07-23 21:45:45 +02:00
|
|
|
#include "ipa-prop.h"
|
2009-05-25 23:59:24 +02:00
|
|
|
#include "except.h"
|
2011-04-17 16:22:20 +02:00
|
|
|
#include "target.h"
|
2011-04-13 19:26:50 +02:00
|
|
|
#include "ipa-inline.h"
|
2011-04-30 01:42:15 +02:00
|
|
|
#include "ipa-utils.h"
|
2009-05-25 23:59:24 +02:00
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
/* Statistics we collect about inlining algorithm. */
|
2009-05-25 23:59:24 +02:00
|
|
|
static int overall_size;
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
static gcov_type max_count;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Return false when inlining edge E would lead to violating
|
|
|
|
limits on function unit growth or stack usage growth.
|
|
|
|
|
|
|
|
The relative function body growth limit is present generally
|
2011-04-18 20:39:39 +02:00
|
|
|
to avoid problems with non-linear behavior of the compiler.
|
2011-04-17 16:22:20 +02:00
|
|
|
To allow inlining huge functions into tiny wrapper, the limit
|
|
|
|
is always based on the bigger of the two functions considered.
|
|
|
|
|
|
|
|
For stack growth limits we always base the growth in stack usage
|
|
|
|
of the callers. We want to prevent applications from segfaulting
|
|
|
|
on stack overflow when functions with huge stack frames gets
|
|
|
|
inlined. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
static bool
|
2011-04-17 16:22:20 +02:00
|
|
|
caller_growth_limits (struct cgraph_edge *e)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2011-04-06 10:51:23 +02:00
|
|
|
struct cgraph_node *to = e->caller;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *what = cgraph_function_or_thunk_node (e->callee, NULL);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
int newsize;
|
2011-04-17 16:22:20 +02:00
|
|
|
int limit = 0;
|
|
|
|
HOST_WIDE_INT stack_size_limit = 0, inlined_stack;
|
|
|
|
struct inline_summary *info, *what_info, *outer_info = inline_summary (to);
|
|
|
|
|
|
|
|
/* Look for function e->caller is inlined to. While doing
|
|
|
|
so work out the largest function body on the way. As
|
|
|
|
described above, we want to base our function growth
|
|
|
|
limits based on that. Not on the self size of the
|
|
|
|
outer function, not on the self size of inline code
|
|
|
|
we immediately inline to. This is the most relaxed
|
|
|
|
interpretation of the rule "do not grow large functions
|
|
|
|
too much in order to prevent compiler from exploding". */
|
2011-05-01 21:11:07 +02:00
|
|
|
while (true)
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
info = inline_summary (to);
|
|
|
|
if (limit < info->self_size)
|
|
|
|
limit = info->self_size;
|
|
|
|
if (stack_size_limit < info->estimated_self_stack_size)
|
|
|
|
stack_size_limit = info->estimated_self_stack_size;
|
|
|
|
if (to->global.inlined_to)
|
|
|
|
to = to->callers->caller;
|
2011-05-01 21:11:07 +02:00
|
|
|
else
|
|
|
|
break;
|
2011-04-17 16:22:20 +02:00
|
|
|
}
|
2006-03-14 10:57:43 +01:00
|
|
|
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
what_info = inline_summary (what);
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (limit < what_info->self_size)
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
limit = what_info->self_size;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
limit += limit * PARAM_VALUE (PARAM_LARGE_FUNCTION_GROWTH) / 100;
|
|
|
|
|
2006-03-14 10:57:43 +01:00
|
|
|
/* Check the size after inlining against the function limits. But allow
|
|
|
|
the function to shrink if it went over the limits by forced inlining. */
|
2011-04-13 19:26:50 +02:00
|
|
|
newsize = estimate_size_after_inlining (to, e);
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
if (newsize >= info->size
|
2006-03-14 10:57:43 +01:00
|
|
|
&& newsize > PARAM_VALUE (PARAM_LARGE_FUNCTION_INSNS)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
&& newsize > limit)
|
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
e->inline_failed = CIF_LARGE_FUNCTION_GROWTH_LIMIT;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
return false;
|
|
|
|
}
|
2006-11-28 11:53:16 +01:00
|
|
|
|
2011-05-01 21:11:07 +02:00
|
|
|
if (!what_info->estimated_stack_size)
|
|
|
|
return true;
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
/* FIXME: Stack size limit often prevents inlining in Fortran programs
|
|
|
|
due to large i/o datastructures used by the Fortran front-end.
|
2011-04-17 16:22:20 +02:00
|
|
|
We ought to ignore this limit when we know that the edge is executed
|
|
|
|
on every invocation of the caller (i.e. its call statement dominates
|
|
|
|
exit block). We do not track this information, yet. */
|
2011-05-01 21:11:07 +02:00
|
|
|
stack_size_limit += ((gcov_type)stack_size_limit
|
2011-04-17 16:22:20 +02:00
|
|
|
* PARAM_VALUE (PARAM_STACK_FRAME_GROWTH) / 100);
|
2006-11-28 11:53:16 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
inlined_stack = (outer_info->stack_frame_offset
|
|
|
|
+ outer_info->estimated_self_stack_size
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
+ what_info->estimated_stack_size);
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Check new stack consumption with stack consumption at the place
|
|
|
|
stack is used. */
|
|
|
|
if (inlined_stack > stack_size_limit
|
2011-04-18 20:39:39 +02:00
|
|
|
/* If function already has large stack usage from sibling
|
2011-04-17 16:22:20 +02:00
|
|
|
inline call, we can inline, too.
|
|
|
|
This bit overoptimistically assume that we are good at stack
|
|
|
|
packing. */
|
|
|
|
&& inlined_stack > info->estimated_stack_size
|
2006-11-28 11:53:16 +01:00
|
|
|
&& inlined_stack > PARAM_VALUE (PARAM_LARGE_STACK_FRAME))
|
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
e->inline_failed = CIF_LARGE_STACK_FRAME_GROWTH_LIMIT;
|
2006-11-28 11:53:16 +01:00
|
|
|
return false;
|
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Dump info about why inlining has failed. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
report_inline_failed_reason (struct cgraph_edge *e)
|
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " not inlinable: %s/%i -> %s/%i, %s\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (e->caller)), e->caller->uid,
|
|
|
|
xstrdup (cgraph_node_name (e->callee)), e->callee->uid,
|
2011-04-17 16:22:20 +02:00
|
|
|
cgraph_inline_failed_string (e->inline_failed));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Decide if we can inline the edge and possibly update
|
|
|
|
inline_failed reason.
|
|
|
|
We check whether inlining is possible at all and whether
|
|
|
|
caller growth limits allow doing so.
|
|
|
|
|
|
|
|
if REPORT is true, output reason to the dump file. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2009-03-28 12:08:16 +01:00
|
|
|
static bool
|
2011-04-17 16:22:20 +02:00
|
|
|
can_inline_edge_p (struct cgraph_edge *e, bool report)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
bool inlinable = true;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
enum availability avail;
|
2011-07-25 12:40:10 +02:00
|
|
|
struct cgraph_node *callee
|
|
|
|
= cgraph_function_or_thunk_node (e->callee, &avail);
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
tree caller_tree = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (e->caller->symbol.decl);
|
2011-07-25 12:40:10 +02:00
|
|
|
tree callee_tree
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
= callee ? DECL_FUNCTION_SPECIFIC_OPTIMIZATION (callee->symbol.decl) : NULL;
|
|
|
|
struct function *caller_cfun = DECL_STRUCT_FUNCTION (e->caller->symbol.decl);
|
2011-07-25 12:40:10 +02:00
|
|
|
struct function *callee_cfun
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
= callee ? DECL_STRUCT_FUNCTION (callee->symbol.decl) : NULL;
|
2011-07-25 12:40:10 +02:00
|
|
|
|
|
|
|
if (!caller_cfun && e->caller->clone_of)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
caller_cfun = DECL_STRUCT_FUNCTION (e->caller->clone_of->symbol.decl);
|
2011-07-25 12:40:10 +02:00
|
|
|
|
|
|
|
if (!callee_cfun && callee && callee->clone_of)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
callee_cfun = DECL_STRUCT_FUNCTION (callee->clone_of->symbol.decl);
|
2006-01-11 14:13:37 +01:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
gcc_assert (e->inline_failed);
|
2010-04-12 15:37:32 +02:00
|
|
|
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
if (!callee || !callee->analyzed)
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
else if (!inline_summary (callee)->inlinable)
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_FUNCTION_NOT_INLINABLE;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
else if (avail <= AVAIL_OVERWRITABLE)
|
2005-07-28 19:14:57 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
e->inline_failed = CIF_OVERWRITABLE;
|
2005-07-28 19:14:57 +02:00
|
|
|
return false;
|
|
|
|
}
|
2011-12-05 09:51:53 +01:00
|
|
|
else if (e->call_stmt_cannot_inline_p)
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_MISMATCHED_ARGUMENTS;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
|
|
|
/* Don't inline if the functions have different EH personalities. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (DECL_FUNCTION_PERSONALITY (e->caller->symbol.decl)
|
|
|
|
&& DECL_FUNCTION_PERSONALITY (callee->symbol.decl)
|
|
|
|
&& (DECL_FUNCTION_PERSONALITY (e->caller->symbol.decl)
|
|
|
|
!= DECL_FUNCTION_PERSONALITY (callee->symbol.decl)))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_EH_PERSONALITY;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
2012-02-15 01:29:06 +01:00
|
|
|
/* TM pure functions should not be inlined into non-TM_pure
|
|
|
|
functions. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (is_tm_pure (callee->symbol.decl)
|
|
|
|
&& !is_tm_pure (e->caller->symbol.decl))
|
2011-11-08 12:13:41 +01:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_UNSPECIFIED;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Don't inline if the callee can throw non-call exceptions but the
|
|
|
|
caller cannot.
|
|
|
|
FIXME: this is obviously wrong for LTO where STRUCT_FUNCTION is missing.
|
|
|
|
Move the flag into cgraph node or mirror it in the inline summary. */
|
2011-07-25 12:40:10 +02:00
|
|
|
else if (callee_cfun && callee_cfun->can_throw_non_call_exceptions
|
|
|
|
&& !(caller_cfun && caller_cfun->can_throw_non_call_exceptions))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_NON_CALL_EXCEPTIONS;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Check compatibility of target optimization options. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (!targetm.target_option.can_inline_p (e->caller->symbol.decl,
|
|
|
|
callee->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_TARGET_OPTION_MISMATCH;
|
|
|
|
inlinable = false;
|
|
|
|
}
|
|
|
|
/* Check if caller growth allows the inlining. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (!DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl)
|
2011-04-30 16:08:03 +02:00
|
|
|
&& !lookup_attribute ("flatten",
|
|
|
|
DECL_ATTRIBUTES
|
|
|
|
(e->caller->global.inlined_to
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
? e->caller->global.inlined_to->symbol.decl
|
|
|
|
: e->caller->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
&& !caller_growth_limits (e))
|
|
|
|
inlinable = false;
|
|
|
|
/* Don't inline a function with a higher optimization level than the
|
|
|
|
caller. FIXME: this is really just tip of iceberg of handling
|
|
|
|
optimization attribute. */
|
|
|
|
else if (caller_tree != callee_tree)
|
2005-07-28 19:14:57 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
struct cl_optimization *caller_opt
|
|
|
|
= TREE_OPTIMIZATION ((caller_tree)
|
|
|
|
? caller_tree
|
|
|
|
: optimization_default_node);
|
|
|
|
|
|
|
|
struct cl_optimization *callee_opt
|
|
|
|
= TREE_OPTIMIZATION ((callee_tree)
|
|
|
|
? callee_tree
|
|
|
|
: optimization_default_node);
|
|
|
|
|
2011-06-21 08:45:05 +02:00
|
|
|
if (((caller_opt->x_optimize > callee_opt->x_optimize)
|
|
|
|
|| (caller_opt->x_optimize_size != callee_opt->x_optimize_size))
|
|
|
|
/* gcc.dg/pr43564.c. Look at forced inline even in -O0. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
&& !DECL_DISREGARD_INLINE_LIMITS (e->callee->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
2011-07-19 22:20:27 +02:00
|
|
|
e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
|
2011-04-17 16:22:20 +02:00
|
|
|
inlinable = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!inlinable && report)
|
|
|
|
report_inline_failed_reason (e);
|
|
|
|
return inlinable;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Return true if the edge E is inlinable during early inlining. */
|
|
|
|
|
|
|
|
static bool
|
|
|
|
can_early_inline_edge_p (struct cgraph_edge *e)
|
|
|
|
{
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee,
|
|
|
|
NULL);
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Early inliner might get called at WPA stage when IPA pass adds new
|
|
|
|
function. In this case we can not really do any of early inlining
|
|
|
|
because function bodies are missing. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (!gimple_has_body_p (callee->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_BODY_NOT_AVAILABLE;
|
2005-07-28 19:14:57 +02:00
|
|
|
return false;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
/* In early inliner some of callees may not be in SSA form yet
|
|
|
|
(i.e. the callgraph is cyclic and we did not process
|
|
|
|
the callee by early inliner, yet). We don't have CIF code for this
|
|
|
|
case; later we will re-do the decision in the real inliner. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (!gimple_in_ssa_p (DECL_STRUCT_FUNCTION (e->caller->symbol.decl))
|
|
|
|
|| !gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->symbol.decl)))
|
2010-09-07 23:26:34 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, " edge not inlinable: not in SSA form\n");
|
2010-09-07 23:26:34 +02:00
|
|
|
return false;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!can_inline_edge_p (e, true))
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Return true when N is leaf function. Accept cheap builtins
|
|
|
|
in leaf functions. */
|
|
|
|
|
|
|
|
static bool
|
|
|
|
leaf_node_p (struct cgraph_node *n)
|
|
|
|
{
|
|
|
|
struct cgraph_edge *e;
|
|
|
|
for (e = n->callees; e; e = e->next_callee)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (!is_inexpensive_builtin (e->callee->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2010-09-07 23:26:34 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Return true if we are interested in inlining small function. */
|
2005-07-28 19:14:57 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
static bool
|
|
|
|
want_early_inline_function_p (struct cgraph_edge *e)
|
|
|
|
{
|
|
|
|
bool want_inline = true;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
|
2011-04-17 16:22:20 +02:00
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
;
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
|
2011-04-17 16:22:20 +02:00
|
|
|
&& !flag_inline_small_functions)
|
|
|
|
{
|
|
|
|
e->inline_failed = CIF_FUNCTION_NOT_INLINE_CANDIDATE;
|
|
|
|
report_inline_failed_reason (e);
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
else
|
2005-07-28 19:14:57 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
int growth = estimate_edge_growth (e);
|
|
|
|
if (growth <= 0)
|
|
|
|
;
|
|
|
|
else if (!cgraph_maybe_hot_edge_p (e)
|
|
|
|
&& growth > 0)
|
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
|
|
|
|
"call is cold and code would grow by %i\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (e->caller)), e->caller->uid,
|
|
|
|
xstrdup (cgraph_node_name (callee)), callee->uid,
|
2011-04-17 16:22:20 +02:00
|
|
|
growth);
|
|
|
|
want_inline = false;
|
|
|
|
}
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
else if (!leaf_node_p (callee)
|
2011-04-17 16:22:20 +02:00
|
|
|
&& growth > 0)
|
2005-07-28 19:14:57 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
|
|
|
|
"callee is not leaf and code would grow by %i\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (e->caller)), e->caller->uid,
|
|
|
|
xstrdup (cgraph_node_name (callee)), callee->uid,
|
2011-04-17 16:22:20 +02:00
|
|
|
growth);
|
|
|
|
want_inline = false;
|
2005-07-28 19:14:57 +02:00
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
else if (growth > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS))
|
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
|
|
|
|
"growth %i exceeds --param early-inlining-insns\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (e->caller)), e->caller->uid,
|
|
|
|
xstrdup (cgraph_node_name (callee)), callee->uid,
|
2011-04-17 16:22:20 +02:00
|
|
|
growth);
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return want_inline;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Return true if we are interested in inlining small function.
|
|
|
|
When REPORT is true, report reason to dump file. */
|
|
|
|
|
|
|
|
static bool
|
|
|
|
want_inline_small_function_p (struct cgraph_edge *e, bool report)
|
|
|
|
{
|
|
|
|
bool want_inline = true;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
|
2011-04-17 16:22:20 +02:00
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
;
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
|
2011-04-17 16:22:20 +02:00
|
|
|
&& !flag_inline_small_functions)
|
|
|
|
{
|
|
|
|
e->inline_failed = CIF_FUNCTION_NOT_INLINE_CANDIDATE;
|
|
|
|
want_inline = false;
|
2005-07-28 19:14:57 +02:00
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
else
|
2005-07-28 19:14:57 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
int growth = estimate_edge_growth (e);
|
2012-08-19 07:55:20 +02:00
|
|
|
inline_hints hints = estimate_edge_hints (e);
|
2011-04-17 16:22:20 +02:00
|
|
|
|
|
|
|
if (growth <= 0)
|
|
|
|
;
|
2012-08-19 07:55:20 +02:00
|
|
|
/* Apply MAX_INLINE_INSNS_SINGLE limit. Do not do so when
|
|
|
|
hints suggests that inlining given function is very profitable. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (DECL_DECLARED_INLINE_P (callee->symbol.decl)
|
2012-08-19 07:55:20 +02:00
|
|
|
&& growth >= MAX_INLINE_INSNS_SINGLE
|
2012-08-21 08:54:01 +02:00
|
|
|
&& !(hints & (INLINE_HINT_indirect_call
|
2012-09-12 23:51:14 +02:00
|
|
|
| INLINE_HINT_loop_iterations
|
|
|
|
| INLINE_HINT_loop_stride)))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_MAX_INLINE_INSNS_SINGLE_LIMIT;
|
|
|
|
want_inline = false;
|
|
|
|
}
|
2012-01-08 00:35:08 +01:00
|
|
|
/* Before giving up based on fact that caller size will grow, allow
|
|
|
|
functions that are called few times and eliminating the offline
|
|
|
|
copy will lead to overall code size reduction.
|
|
|
|
Not all of these will be handled by subsequent inlining of functions
|
|
|
|
called once: in particular weak functions are not handled or funcitons
|
|
|
|
that inline to multiple calls but a lot of bodies is optimized out.
|
|
|
|
Finally we want to inline earlier to allow inlining of callbacks.
|
|
|
|
|
|
|
|
This is slightly wrong on aggressive side: it is entirely possible
|
|
|
|
that function is called many times with a context where inlining
|
|
|
|
reduces code size and few times with a context where inlining increase
|
|
|
|
code size. Resoluting growth estimate will be negative even if it
|
|
|
|
would make more sense to keep offline copy and do not inline into the
|
|
|
|
call sites that makes the code size grow.
|
|
|
|
|
|
|
|
When badness orders the calls in a way that code reducing calls come
|
|
|
|
first, this situation is not a problem at all: after inlining all
|
|
|
|
"good" calls, we will realize that keeping the function around is
|
|
|
|
better. */
|
|
|
|
else if (growth <= MAX_INLINE_INSNS_SINGLE
|
|
|
|
/* Unlike for functions called once, we play unsafe with
|
|
|
|
COMDATs. We can allow that since we know functions
|
|
|
|
in consideration are small (and thus risk is small) and
|
|
|
|
moreover grow estimates already accounts that COMDAT
|
|
|
|
functions may or may not disappear when eliminated from
|
|
|
|
current unit. With good probability making aggressive
|
|
|
|
choice in all units is going to make overall program
|
|
|
|
smaller.
|
|
|
|
|
|
|
|
Consequently we ask cgraph_can_remove_if_no_direct_calls_p
|
|
|
|
instead of
|
|
|
|
cgraph_will_be_removed_from_program_if_no_direct_calls */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
&& !DECL_EXTERNAL (callee->symbol.decl)
|
2012-01-08 00:35:08 +01:00
|
|
|
&& cgraph_can_remove_if_no_direct_calls_p (callee)
|
|
|
|
&& estimate_growth (callee) <= 0)
|
|
|
|
;
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
|
2011-04-17 16:22:20 +02:00
|
|
|
&& !flag_inline_functions)
|
|
|
|
{
|
|
|
|
e->inline_failed = CIF_NOT_DECLARED_INLINED;
|
|
|
|
want_inline = false;
|
|
|
|
}
|
2012-08-19 07:55:20 +02:00
|
|
|
/* Apply MAX_INLINE_INSNS_AUTO limit for functions not declared inline
|
|
|
|
Upgrade it to MAX_INLINE_INSNS_SINGLE when hints suggests that
|
|
|
|
inlining given function is very profitable. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
else if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
|
2012-09-06 00:32:36 +02:00
|
|
|
&& growth >= ((hints & (INLINE_HINT_indirect_call
|
2012-09-12 23:51:14 +02:00
|
|
|
| INLINE_HINT_loop_iterations
|
|
|
|
| INLINE_HINT_loop_stride))
|
2012-08-19 07:55:20 +02:00
|
|
|
? MAX (MAX_INLINE_INSNS_AUTO,
|
|
|
|
MAX_INLINE_INSNS_SINGLE)
|
|
|
|
: MAX_INLINE_INSNS_AUTO))
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
e->inline_failed = CIF_MAX_INLINE_INSNS_AUTO_LIMIT;
|
|
|
|
want_inline = false;
|
|
|
|
}
|
2012-01-08 00:35:08 +01:00
|
|
|
/* If call is cold, do not inline when function body would grow. */
|
|
|
|
else if (!cgraph_maybe_hot_edge_p (e))
|
2005-07-28 19:14:57 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
e->inline_failed = CIF_UNLIKELY_CALL;
|
|
|
|
want_inline = false;
|
2005-07-28 19:14:57 +02:00
|
|
|
}
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!want_inline && report)
|
|
|
|
report_inline_failed_reason (e);
|
|
|
|
return want_inline;
|
|
|
|
}
|
2005-07-28 19:14:57 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
/* EDGE is self recursive edge.
|
|
|
|
We hand two cases - when function A is inlining into itself
|
|
|
|
or when function A is being inlined into another inliner copy of function
|
|
|
|
A within function B.
|
|
|
|
|
|
|
|
In first case OUTER_NODE points to the toplevel copy of A, while
|
|
|
|
in the second case OUTER_NODE points to the outermost copy of A in B.
|
|
|
|
|
|
|
|
In both cases we want to be extra selective since
|
|
|
|
inlining the call will just introduce new recursive calls to appear. */
|
2011-04-18 20:39:39 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
static bool
|
|
|
|
want_inline_self_recursive_call_p (struct cgraph_edge *edge,
|
|
|
|
struct cgraph_node *outer_node,
|
|
|
|
bool peeling,
|
|
|
|
int depth)
|
|
|
|
{
|
|
|
|
char const *reason = NULL;
|
|
|
|
bool want_inline = true;
|
|
|
|
int caller_freq = CGRAPH_FREQ_BASE;
|
|
|
|
int max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH_AUTO);
|
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (DECL_DECLARED_INLINE_P (edge->caller->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
max_depth = PARAM_VALUE (PARAM_MAX_INLINE_RECURSIVE_DEPTH);
|
|
|
|
|
|
|
|
if (!cgraph_maybe_hot_edge_p (edge))
|
|
|
|
{
|
|
|
|
reason = "recursive call is cold";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
else if (max_count && !outer_node->count)
|
|
|
|
{
|
|
|
|
reason = "not executed in profile";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
else if (depth > max_depth)
|
|
|
|
{
|
|
|
|
reason = "--param max-inline-recursive-depth exceeded.";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (outer_node->global.inlined_to)
|
|
|
|
caller_freq = outer_node->callers->frequency;
|
|
|
|
|
|
|
|
if (!want_inline)
|
|
|
|
;
|
|
|
|
/* Inlining of self recursive function into copy of itself within other function
|
|
|
|
is transformation similar to loop peeling.
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
Peeling is profitable if we can inline enough copies to make probability
|
2011-04-17 16:22:20 +02:00
|
|
|
of actual call to the self recursive function very small. Be sure that
|
|
|
|
the probability of recursion is small.
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
We ensure that the frequency of recursing is at most 1 - (1/max_depth).
|
|
|
|
This way the expected number of recision is at most max_depth. */
|
2011-04-17 16:22:20 +02:00
|
|
|
else if (peeling)
|
|
|
|
{
|
|
|
|
int max_prob = CGRAPH_FREQ_BASE - ((CGRAPH_FREQ_BASE + max_depth - 1)
|
|
|
|
/ max_depth);
|
|
|
|
int i;
|
|
|
|
for (i = 1; i < depth; i++)
|
|
|
|
max_prob = max_prob * max_prob / CGRAPH_FREQ_BASE;
|
|
|
|
if (max_count
|
|
|
|
&& (edge->count * CGRAPH_FREQ_BASE / outer_node->count
|
|
|
|
>= max_prob))
|
|
|
|
{
|
|
|
|
reason = "profile of recursive call is too large";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
if (!max_count
|
|
|
|
&& (edge->frequency * CGRAPH_FREQ_BASE / caller_freq
|
|
|
|
>= max_prob))
|
|
|
|
{
|
|
|
|
reason = "frequency of recursive call is too large";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
}
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Recursive inlining, i.e. equivalent of unrolling, is profitable if recursion
|
2011-04-17 16:22:20 +02:00
|
|
|
depth is large. We reduce function call overhead and increase chances that
|
|
|
|
things fit in hardware return predictor.
|
|
|
|
|
|
|
|
Recursive inlining might however increase cost of stack frame setup
|
|
|
|
actually slowing down functions whose recursion tree is wide rather than
|
|
|
|
deep.
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
Deciding reliably on when to do recursive inlining without profile feedback
|
2011-04-17 16:22:20 +02:00
|
|
|
is tricky. For now we disable recursive inlining when probability of self
|
|
|
|
recursion is low.
|
|
|
|
|
|
|
|
Recursive inlining of self recursive call within loop also results in large loop
|
|
|
|
depths that generally optimize badly. We may want to throttle down inlining
|
|
|
|
in those cases. In particular this seems to happen in one of libstdc++ rb tree
|
|
|
|
methods. */
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (max_count
|
|
|
|
&& (edge->count * 100 / outer_node->count
|
|
|
|
<= PARAM_VALUE (PARAM_MIN_INLINE_RECURSIVE_PROBABILITY)))
|
|
|
|
{
|
|
|
|
reason = "profile of recursive call is too small";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
else if (!max_count
|
|
|
|
&& (edge->frequency * 100 / caller_freq
|
|
|
|
<= PARAM_VALUE (PARAM_MIN_INLINE_RECURSIVE_PROBABILITY)))
|
|
|
|
{
|
|
|
|
reason = "frequency of recursive call is too small";
|
|
|
|
want_inline = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (!want_inline && dump_file)
|
|
|
|
fprintf (dump_file, " not inlining recursively: %s\n", reason);
|
|
|
|
return want_inline;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
2011-06-13 11:19:09 +02:00
|
|
|
/* Return true when NODE has caller other than EDGE.
|
|
|
|
Worker for cgraph_for_node_and_aliases. */
|
|
|
|
|
|
|
|
static bool
|
|
|
|
check_caller_edge (struct cgraph_node *node, void *edge)
|
|
|
|
{
|
|
|
|
return (node->callers
|
|
|
|
&& node->callers != edge);
|
|
|
|
}
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
|
|
|
|
/* Decide if NODE is called once inlining it would eliminate need
|
|
|
|
for the offline copy of function. */
|
|
|
|
|
|
|
|
static bool
|
|
|
|
want_inline_function_called_once_p (struct cgraph_node *node)
|
|
|
|
{
|
2011-06-13 11:19:09 +02:00
|
|
|
struct cgraph_node *function = cgraph_function_or_thunk_node (node, NULL);
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Already inlined? */
|
2011-06-13 11:19:09 +02:00
|
|
|
if (function->global.inlined_to)
|
2011-04-18 20:39:39 +02:00
|
|
|
return false;
|
|
|
|
/* Zero or more then one callers? */
|
|
|
|
if (!node->callers
|
|
|
|
|| node->callers->next_caller)
|
|
|
|
return false;
|
2011-06-13 11:19:09 +02:00
|
|
|
/* Maybe other aliases has more direct calls. */
|
|
|
|
if (cgraph_for_node_and_aliases (node, check_caller_edge, node->callers, true))
|
|
|
|
return false;
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Recursive call makes no sense to inline. */
|
2011-06-13 11:19:09 +02:00
|
|
|
if (cgraph_edge_recursive_p (node->callers))
|
2011-04-18 20:39:39 +02:00
|
|
|
return false;
|
|
|
|
/* External functions are not really in the unit, so inlining
|
|
|
|
them when called once would just increase the program size. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (DECL_EXTERNAL (function->symbol.decl))
|
2011-04-18 20:39:39 +02:00
|
|
|
return false;
|
|
|
|
/* Offline body must be optimized out. */
|
2011-06-13 11:19:09 +02:00
|
|
|
if (!cgraph_will_be_removed_from_program_if_no_direct_calls (function))
|
2011-04-18 20:39:39 +02:00
|
|
|
return false;
|
|
|
|
if (!can_inline_edge_p (node->callers, true))
|
|
|
|
return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2011-05-07 22:31:37 +02:00
|
|
|
|
|
|
|
/* Return relative time improvement for inlining EDGE in range
|
|
|
|
1...2^9. */
|
|
|
|
|
|
|
|
static inline int
|
|
|
|
relative_time_benefit (struct inline_summary *callee_info,
|
|
|
|
struct cgraph_edge *edge,
|
|
|
|
int time_growth)
|
|
|
|
{
|
|
|
|
int relbenefit;
|
|
|
|
gcov_type uninlined_call_time;
|
|
|
|
|
|
|
|
uninlined_call_time =
|
|
|
|
((gcov_type)
|
|
|
|
(callee_info->time
|
2011-09-22 01:10:07 +02:00
|
|
|
+ inline_edge_summary (edge)->call_stmt_time) * edge->frequency
|
|
|
|
+ CGRAPH_FREQ_BASE / 2) / CGRAPH_FREQ_BASE;
|
2011-05-07 22:31:37 +02:00
|
|
|
/* Compute relative time benefit, i.e. how much the call becomes faster.
|
|
|
|
??? perhaps computing how much the caller+calle together become faster
|
|
|
|
would lead to more realistic results. */
|
|
|
|
if (!uninlined_call_time)
|
|
|
|
uninlined_call_time = 1;
|
|
|
|
relbenefit =
|
|
|
|
(uninlined_call_time - time_growth) * 256 / (uninlined_call_time);
|
|
|
|
relbenefit = MIN (relbenefit, 512);
|
|
|
|
relbenefit = MAX (relbenefit, 1);
|
|
|
|
return relbenefit;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-05-25 14:34:01 +02:00
|
|
|
/* A cost model driving the inlining heuristics in a way so the edges with
|
|
|
|
smallest badness are inlined first. After each inlining is performed
|
c-common.c, [...]: Fix comment typos.
* c-common.c, c-parser.c, cfgbuild.c, cfghooks.c, cfghooks.h,
cfgrtl.c, cgraphunit.c, ddg.c, expr.h, gcse.c, ggc-page.c,
ggc-zone.c, gimplify.c, ipa-inline.c, longlong.h, targhooks.c,
tree-flow-inline.h, tree-pass.h, tree-ssa-dse.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c,
tree-ssa-operands.c, tree-vect-analyze.c,
tree-vect-transform.c, tree-vectorizer.c, tree.c,
config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
config/frv/frv.md, config/i386/i386.c, config/i386/sse.md,
config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
config/mcore/mcore.c, config/mips/mips.c, config/mips/mips.md,
config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c,
config/rs6000/rs6000.h, config/sh/sh.c, config/sh/sh.md,
config/sh/ushmedia.h, config/sparc/sparc.c,
config/sparc/sparc.md, config/stormy16/stormy-abi: Fix comment
typos. Follow spelling conventions.
* doc/invoke.texi, doc/tm.texi, doc/tree-ssa.texi: Fix typos.
Follow spelling conventions.
From-SVN: r100218
2005-05-26 20:15:27 +02:00
|
|
|
the costs of all caller edges of nodes affected are recomputed so the
|
2005-05-25 14:34:01 +02:00
|
|
|
metrics may accurately depend on values such as number of inlinable callers
|
2007-02-09 23:49:30 +01:00
|
|
|
of the function or function body size. */
|
2005-05-25 14:34:01 +02:00
|
|
|
|
|
|
|
static int
|
2011-04-17 16:22:20 +02:00
|
|
|
edge_badness (struct cgraph_edge *edge, bool dump)
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
2009-05-25 23:59:24 +02:00
|
|
|
gcov_type badness;
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
int growth, time_growth;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (edge->callee,
|
|
|
|
NULL);
|
|
|
|
struct inline_summary *callee_info = inline_summary (callee);
|
2012-08-19 07:55:20 +02:00
|
|
|
inline_hints hints;
|
2007-02-09 23:49:30 +01:00
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
|
2010-05-11 17:15:48 +02:00
|
|
|
return INT_MIN;
|
|
|
|
|
2011-04-13 19:26:50 +02:00
|
|
|
growth = estimate_edge_growth (edge);
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
time_growth = estimate_edge_time (edge);
|
2012-08-19 07:55:20 +02:00
|
|
|
hints = estimate_edge_hints (edge);
|
lto-streamer.h (struct lto_streamer_cache_d): Remove offsets and next_slot members.
* lto-streamer.h (struct lto_streamer_cache_d): Remove offsets
and next_slot members.
(lto_streamer_cache_insert, lto_streamer_cache_insert_at,
lto_streamer_cache_lookup, lto_streamer_cache_get): Adjust prototypes.
(lto_streamer_cache_append): Declare.
* lto-streamer.c (lto_streamer_cache_add_to_node_array): Use
unsigned index, remove offset parameter, ensure that we append
or update existing entries.
(lto_streamer_cache_insert_1): Use unsigned index, remove offset_p
parameter, update next_slot for append.
(lto_streamer_cache_insert): Use unsigned index, remove offset_p
parameter.
(lto_streamer_cache_insert_at): Likewise.
(lto_streamer_cache_append): New function.
(lto_streamer_cache_lookup): Use unsigned index.
(lto_streamer_cache_get): Likewise.
(lto_record_common_node): Don't test tree_node_can_be_shared.
(preload_common_node): Adjust call to lto_streamer_cache_insert.
(lto_streamer_cache_delete): Don't free offsets member.
* lto-streamer-out.c (eq_string_slot_node): Use memcmp.
(lto_output_string_with_length): Use lto_output_data_stream.
(lto_output_tree_header): Remove ix parameter, don't write it.
(lto_output_builtin_tree): Likewise.
(lto_write_tree): Adjust callers to above, don't track and write
offset, write unsigned index.
(output_unreferenced_globals): Don't emit all global vars.
(write_global_references): Use unsigned indices.
(lto_output_decl_state_refs): Likewise.
(write_symbol): Likewise.
* lto-streamer-in.c (lto_input_chain): Move earlier.
(input_function): Use unsigned index.
(input_alias_pairs): Don't read and then ignore all global vars.
(lto_materialize_tree): Remove ix_p parameter, don't read index,
don't pass it back, use lto_streamer_cache_append.
(lto_register_var_decl_in_symtab): Use unsigned index.
(lto_register_function_decl_in_symtab): Likewise.
(lto_get_pickled_tree): Don't read in or handle offset, read unsigned
index.
(lto_get_builtin_tree): Don't read index, use
lto_streamer_cache_append.
(lto_read_tree): Adjust call to lto_materialize_tree.
* ipa-inline.c (cgraph_edge_badness): Move growth calculaton,
don't use function calls in arguments to MIN.
* varasm.c (decl_binds_to_current_def_p): Don't check TREE_PUBLIC
twice.
* gimple.c (gimple_type_leader_entry): Mark deletable.
lto/
* lto.c (lto_materialize_function): Don't read and then discard
sections in WPA mode.
(lto_read_in_decl_state): Adjust call to lto_streamer_cache_get.
* lto-lang.c (registered_builtin_fndecls): Remove.
(lto_getdecls): Return NULL_TREE.
(lto_builtin_function): Don't remember in registered_builtin_fndecls.
From-SVN: r171906
2011-04-03 13:21:06 +02:00
|
|
|
|
2010-04-13 20:22:35 +02:00
|
|
|
if (dump)
|
|
|
|
{
|
2011-02-11 16:16:46 +01:00
|
|
|
fprintf (dump_file, " Badness calculation for %s -> %s\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (edge->caller)),
|
|
|
|
xstrdup (cgraph_node_name (callee)));
|
2012-08-19 07:55:20 +02:00
|
|
|
fprintf (dump_file, " size growth %i, time growth %i ",
|
2010-04-13 20:22:35 +02:00
|
|
|
growth,
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
time_growth);
|
2012-08-19 07:55:20 +02:00
|
|
|
dump_inline_hints (dump_file, hints);
|
|
|
|
fprintf (dump_file, "\n");
|
2010-04-13 20:22:35 +02:00
|
|
|
}
|
2007-02-09 23:49:30 +01:00
|
|
|
|
|
|
|
/* Always prefer inlining saving code size. */
|
|
|
|
if (growth <= 0)
|
2010-04-13 20:22:35 +02:00
|
|
|
{
|
2011-05-07 22:31:37 +02:00
|
|
|
badness = INT_MIN / 2 + growth;
|
2010-04-13 20:22:35 +02:00
|
|
|
if (dump)
|
2011-05-07 22:31:37 +02:00
|
|
|
fprintf (dump_file, " %i: Growth %i <= 0\n", (int) badness,
|
2010-04-13 20:22:35 +02:00
|
|
|
growth);
|
|
|
|
}
|
2007-02-09 23:49:30 +01:00
|
|
|
|
2011-05-07 22:31:37 +02:00
|
|
|
/* When profiling is available, compute badness as:
|
|
|
|
|
|
|
|
relative_edge_count * relative_time_benefit
|
|
|
|
goodness = -------------------------------------------
|
|
|
|
edge_growth
|
|
|
|
badness = -goodness
|
|
|
|
|
2012-05-29 16:14:06 +02:00
|
|
|
The fraction is upside down, because on edge counts and time beneits
|
2011-05-07 22:31:37 +02:00
|
|
|
the bounds are known. Edge growth is essentially unlimited. */
|
|
|
|
|
2007-02-11 22:28:32 +01:00
|
|
|
else if (max_count)
|
2010-04-13 20:22:35 +02:00
|
|
|
{
|
2011-05-07 22:31:37 +02:00
|
|
|
int relbenefit = relative_time_benefit (callee_info, edge, time_growth);
|
2010-04-13 20:22:35 +02:00
|
|
|
badness =
|
|
|
|
((int)
|
2011-05-07 22:31:37 +02:00
|
|
|
((double) edge->count * INT_MIN / 2 / max_count / 512) *
|
|
|
|
relative_time_benefit (callee_info, edge, time_growth)) / growth;
|
2011-04-18 20:39:39 +02:00
|
|
|
|
|
|
|
/* Be sure that insanity of the profile won't lead to increasing counts
|
|
|
|
in the scalling and thus to overflow in the computation above. */
|
|
|
|
gcc_assert (max_count >= edge->count);
|
2010-04-13 20:22:35 +02:00
|
|
|
if (dump)
|
|
|
|
{
|
|
|
|
fprintf (dump_file,
|
|
|
|
" %i (relative %f): profile info. Relative count %f"
|
|
|
|
" * Relative benefit %f\n",
|
|
|
|
(int) badness, (double) badness / INT_MIN,
|
|
|
|
(double) edge->count / max_count,
|
2011-05-07 22:31:37 +02:00
|
|
|
relbenefit * 100 / 256.0);
|
2010-04-13 20:22:35 +02:00
|
|
|
}
|
|
|
|
}
|
2007-02-09 23:49:30 +01:00
|
|
|
|
2011-05-07 22:31:37 +02:00
|
|
|
/* When function local profile is available. Compute badness as:
|
2007-02-09 23:49:30 +01:00
|
|
|
|
2011-05-07 22:31:37 +02:00
|
|
|
|
|
|
|
growth_of_callee
|
|
|
|
badness = -------------------------------------- + growth_for-all
|
|
|
|
relative_time_benefit * edge_frequency
|
|
|
|
|
|
|
|
*/
|
2007-02-09 23:49:30 +01:00
|
|
|
else if (flag_guess_branch_prob)
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
2011-05-07 22:31:37 +02:00
|
|
|
int div = edge->frequency * (1<<10) / CGRAPH_FREQ_MAX;
|
2009-11-25 11:55:54 +01:00
|
|
|
|
2011-05-07 22:31:37 +02:00
|
|
|
div = MAX (div, 1);
|
|
|
|
gcc_checking_assert (edge->frequency <= CGRAPH_FREQ_MAX);
|
|
|
|
div *= relative_time_benefit (callee_info, edge, time_growth);
|
|
|
|
|
|
|
|
/* frequency is normalized in range 1...2^10.
|
|
|
|
relbenefit in range 1...2^9
|
|
|
|
DIV should be in range 1....2^19. */
|
|
|
|
gcc_checking_assert (div >= 1 && div <= (1<<19));
|
|
|
|
|
|
|
|
/* Result must be integer in range 0...INT_MAX.
|
|
|
|
Set the base of fixed point calculation so we don't lose much of
|
|
|
|
precision for small bandesses (those are interesting) yet we don't
|
2011-10-23 16:30:24 +02:00
|
|
|
overflow for growths that are still in interesting range.
|
|
|
|
|
2012-10-28 10:50:58 +01:00
|
|
|
Fixed point arithmetic with point at 6th bit. */
|
|
|
|
badness = ((gcov_type)growth) * (1<<(19+6));
|
2011-05-07 22:31:37 +02:00
|
|
|
badness = (badness + div / 2) / div;
|
|
|
|
|
|
|
|
/* Overall growth of inlining all calls of function matters: we want to
|
|
|
|
inline so offline copy of function is no longer needed.
|
|
|
|
|
|
|
|
Additionally functions that can be fully inlined without much of
|
|
|
|
effort are better inline candidates than functions that can be fully
|
|
|
|
inlined only after noticeable overall unit growths. The latter
|
|
|
|
are better in a sense compressing of code size by factoring out common
|
|
|
|
code into separate function shared by multiple code paths.
|
|
|
|
|
|
|
|
We might mix the valud into the fraction by taking into account
|
|
|
|
relative growth of the unit, but for now just add the number
|
|
|
|
into resulting fraction. */
|
2012-10-28 13:00:32 +01:00
|
|
|
if (badness > INT_MAX / 8)
|
2011-10-23 16:30:24 +02:00
|
|
|
{
|
2012-10-28 13:00:32 +01:00
|
|
|
badness = INT_MAX / 8;
|
2011-10-23 16:30:24 +02:00
|
|
|
if (dump)
|
|
|
|
fprintf (dump_file, "Badness overflow\n");
|
|
|
|
}
|
2012-08-21 08:54:01 +02:00
|
|
|
if (hints & (INLINE_HINT_indirect_call
|
2012-09-12 23:51:14 +02:00
|
|
|
| INLINE_HINT_loop_iterations
|
|
|
|
| INLINE_HINT_loop_stride))
|
2012-08-19 07:55:20 +02:00
|
|
|
badness /= 8;
|
2012-10-28 10:50:58 +01:00
|
|
|
if (hints & (INLINE_HINT_same_scc))
|
|
|
|
badness *= 4;
|
|
|
|
if (hints & (INLINE_HINT_in_scc))
|
|
|
|
badness *= 2;
|
2010-04-13 20:22:35 +02:00
|
|
|
if (dump)
|
|
|
|
{
|
|
|
|
fprintf (dump_file,
|
2011-12-07 12:55:16 +01:00
|
|
|
" %i: guessed profile. frequency %f,"
|
2011-05-07 22:31:37 +02:00
|
|
|
" benefit %f%%, divisor %i\n",
|
2011-12-07 12:55:16 +01:00
|
|
|
(int) badness, (double)edge->frequency / CGRAPH_FREQ_BASE,
|
2011-05-07 22:31:37 +02:00
|
|
|
relative_time_benefit (callee_info, edge, time_growth) * 100 / 256.0, div);
|
2010-04-13 20:22:35 +02:00
|
|
|
}
|
2007-02-09 23:49:30 +01:00
|
|
|
}
|
|
|
|
/* When function local profile is not available or it does not give
|
|
|
|
useful information (ie frequency is zero), base the cost on
|
|
|
|
loop nest and overall size growth, so we optimize for overall number
|
|
|
|
of functions fully inlined in program. */
|
|
|
|
else
|
|
|
|
{
|
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraphbuild.c (build_cgraph_edges): Update call
of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraph.c (cgraph_create_edge_including_clones,
cgraph_create_edge_1, cgraph_allocate_init_indirect_info,
cgraph_update_edges_for_call_stmt_node): Do not take nest
argument; do not initialize call_stmt_size/time.
(dump_cgraph_node): Do not dump nest.
(cgraph_clone_edge): Do not take loop_nest argument;
do not propagate it; do not clone call_stmt_size/time.
(cgraph_clone_node): Likewise.
(cgraph_create_virtual_clone): Update.
* cgraph.h (struct cgraph_edge): Remove
call_stmt_size/call_stmt_time/loop_nest.
(cgraph_create_edge, cgraph_create_indirect_edge,
cgraph_create_edge_including_clones, cgraph_clone_node): Update
prototype.
* tree-emutls.c (gen_emutls_addr): Update.
* ipa-inline-transform.c (update_noncloned_frequencies): Do not handle
loop_nest; handle indirect calls, too.
(clone_inlined_nodes): Do not care about updating inline summaries.
* cgraphunit.c (cgraph_copy_node_for_versioning): Update.
* lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not
stream call_stmt_size/call_stmt_time/loop_nest.
* ipa-inline.c (edge_badness): Update.
(ipa_inline): dump summaries after inlining.
* ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t):
new.
(inline_edge_summary): New function.
* ipa-inline-analysis.c (edge_duplication_hook_holder): New holder.
(inline_edge_removal_hook): Handle edge summaries.
(inline_edge_duplication_hook): New hook.
(inline_summary_alloc): Alloc hooks.
(initialize_growth_caches): Do not register removal hooks.
(free_growth_caches); Do not free removal hook.
(dump_inline_edge_summary): New function.
(dump_inline_summary): Use it.
(estimate_function_body_sizes, estimate_edge_size_and_time): Update.
(inline_update_callee_summaries): New function.
(inline_merge_summary): Use it.
(do_estimate_edge_time, do_estimate_edge_growth): Update.
(read_inline_edge_summary): New function.
(inline_read_section): Use it.
(write_inline_edge_summary): New function.
(inline_write_summary): Use it.
(inline_free_summary): Free edge new holders.
* tree-inline.c (copy_bb): Update.
From-SVN: r172989
2011-04-27 00:05:50 +02:00
|
|
|
int nest = MIN (inline_edge_summary (edge)->loop_depth, 8);
|
2011-12-13 13:54:57 +01:00
|
|
|
badness = growth * 256;
|
2005-05-25 14:34:01 +02:00
|
|
|
|
2007-02-09 23:49:30 +01:00
|
|
|
/* Decrease badness if call is nested. */
|
2009-11-25 11:55:54 +01:00
|
|
|
if (badness > 0)
|
2007-02-09 23:49:30 +01:00
|
|
|
badness >>= nest;
|
|
|
|
else
|
2010-04-13 20:22:35 +02:00
|
|
|
{
|
2007-02-09 23:49:30 +01:00
|
|
|
badness <<= nest;
|
2010-04-13 20:22:35 +02:00
|
|
|
}
|
|
|
|
if (dump)
|
|
|
|
fprintf (dump_file, " %i: no profile. nest %i\n", (int) badness,
|
|
|
|
nest);
|
2005-05-25 14:34:01 +02:00
|
|
|
}
|
2010-04-13 20:22:35 +02:00
|
|
|
|
|
|
|
/* Ensure that we did not overflow in all the fixed point math above. */
|
|
|
|
gcc_assert (badness >= INT_MIN);
|
|
|
|
gcc_assert (badness <= INT_MAX - 1);
|
2007-02-09 23:49:30 +01:00
|
|
|
/* Make recursive inlining happen always after other inlining is done. */
|
2011-04-06 10:51:23 +02:00
|
|
|
if (cgraph_edge_recursive_p (edge))
|
2007-02-09 23:49:30 +01:00
|
|
|
return badness + 1;
|
2005-05-25 14:34:01 +02:00
|
|
|
else
|
2007-02-09 23:49:30 +01:00
|
|
|
return badness;
|
2005-05-25 14:34:01 +02:00
|
|
|
}
|
|
|
|
|
2010-07-03 21:33:14 +02:00
|
|
|
/* Recompute badness of EDGE and update its key in HEAP if needed. */
|
2011-04-17 16:22:20 +02:00
|
|
|
static inline void
|
2010-07-03 21:33:14 +02:00
|
|
|
update_edge_key (fibheap_t heap, struct cgraph_edge *edge)
|
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
int badness = edge_badness (edge, false);
|
2010-07-03 21:33:14 +02:00
|
|
|
if (edge->aux)
|
|
|
|
{
|
|
|
|
fibnode_t n = (fibnode_t) edge->aux;
|
|
|
|
gcc_checking_assert (n->data == edge);
|
|
|
|
|
|
|
|
/* fibheap_replace_key only decrease the keys.
|
|
|
|
When we increase the key we do not update heap
|
|
|
|
and instead re-insert the element once it becomes
|
2011-02-11 16:16:46 +01:00
|
|
|
a minimum of heap. */
|
2010-07-03 21:33:14 +02:00
|
|
|
if (badness < n->key)
|
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file,
|
|
|
|
" decreasing badness %s/%i -> %s/%i, %i to %i\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (edge->caller)),
|
|
|
|
edge->caller->uid,
|
|
|
|
xstrdup (cgraph_node_name (edge->callee)),
|
|
|
|
edge->callee->uid,
|
2011-04-17 16:22:20 +02:00
|
|
|
(int)n->key,
|
|
|
|
badness);
|
|
|
|
}
|
2011-05-07 22:31:37 +02:00
|
|
|
fibheap_replace_key (heap, n, badness);
|
2010-07-03 21:33:14 +02:00
|
|
|
gcc_checking_assert (n->key == badness);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2011-04-17 16:22:20 +02:00
|
|
|
{
|
|
|
|
if (dump_file && (dump_flags & TDF_DETAILS))
|
|
|
|
{
|
|
|
|
fprintf (dump_file,
|
|
|
|
" enqueuing call %s/%i -> %s/%i, badness %i\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (edge->caller)),
|
|
|
|
edge->caller->uid,
|
|
|
|
xstrdup (cgraph_node_name (edge->callee)),
|
|
|
|
edge->callee->uid,
|
2011-04-17 16:22:20 +02:00
|
|
|
badness);
|
|
|
|
}
|
|
|
|
edge->aux = fibheap_insert (heap, badness, edge);
|
|
|
|
}
|
2010-07-03 21:33:14 +02:00
|
|
|
}
|
|
|
|
|
2011-05-05 00:48:54 +02:00
|
|
|
|
|
|
|
/* NODE was inlined.
|
|
|
|
All caller edges needs to be resetted because
|
|
|
|
size estimates change. Similarly callees needs reset
|
|
|
|
because better context may be known. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
reset_edge_caches (struct cgraph_node *node)
|
|
|
|
{
|
|
|
|
struct cgraph_edge *edge;
|
|
|
|
struct cgraph_edge *e = node->callees;
|
|
|
|
struct cgraph_node *where = node;
|
2011-06-13 17:34:59 +02:00
|
|
|
int i;
|
|
|
|
struct ipa_ref *ref;
|
2011-05-05 00:48:54 +02:00
|
|
|
|
|
|
|
if (where->global.inlined_to)
|
|
|
|
where = where->global.inlined_to;
|
|
|
|
|
|
|
|
/* WHERE body size has changed, the cached growth is invalid. */
|
|
|
|
reset_node_growth_cache (where);
|
|
|
|
|
|
|
|
for (edge = where->callers; edge; edge = edge->next_caller)
|
|
|
|
if (edge->inline_failed)
|
|
|
|
reset_edge_growth_cache (edge);
|
lto-symtab.c (lto_cgraph_replace_node): Update.
* lto-symtab.c (lto_cgraph_replace_node): Update.
* cgraphbuild.c (record_reference, record_type_list,
record_eh_tables, mark_address, mark_load, mark_store): Update.
* cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
Update.
* cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
(cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
* reload.c: Fix typo in comment.
* rtlanal.c: Likewise.
* tree-emultls.c (gen_emutls_addr): Update.
* ipa-reference.c (analyze_function): Update.
* cgraphunit.c (cgraph_analyze_function,
cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
Update.
* ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
(ipa_remove_reference): Likewise.
(ipa_remove_all_refering): Rename to ...
(ipa_remove_all_referring): ... this one; update.
(ipa_dump_references): Update.
(ipa_dump_referring): Update.
(ipa_clone_references): Update.
(ipa_clone_refering): Rename to ...
(ipa_clone_referring): ... this one; update.
(ipa_ref_cannot_lead_to_return): Update.
(ipa_ref_has_aliases_p): Update.
* ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
forward typedefs.
(ipa_ref_type): Remove.
(ipa_ref_ptr_u): Remove.
(ipa_ref): Remove referencing, refered, refered_index, refering_type
and refered_type; add referring, referred and referred_index.
(ipa_ref_list): Rename refering to referring.
(ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
ipa_clone_references, ipa_clone_referring): Update prototypes.
* lto-cgraph.c (referenced_from_other_partition_p): Update.
(lto_output_ref): Update.
(add_references): Update.
(input_varpool_node): Update.
(input_refs): Update.
* ipa-ref-inline.h (ipa_ref_node): Update.
(ipa_ref_varpool_node): Update.
(ipa_ref_referring_node); Update.
(ipa_ref_referring_varpool_node): Update.
(ipa_ref_referring_ref_list); Update.
(ipa_ref_referred_ref_list): Update.
(ipa_ref_list_first_referring): Update.
(ipa_empty_ref_list): Update.
(ipa_ref_list_refering_iterate): Rename to ...
(ipa_ref_list_referring_iterate): ... this one.
* cse.c: Update comment.
* ipa-utils.c (ipa_reverse_postorder): Update.
* tree-ssa-alias.c: Update.
* ipa-inline.c (reset_edge_caches): Update.
(update_caller_keys): Update.
* ipa-inline.h: Update comments.
* jump.c: Update comment.
* alias.c: Likewise.
* ipa.c (process_references): Update.
(cgraph_remove_unreachable_nodes): Likewise.
(ipa_discover_readonly_nonaddressable_var): Likewise.
(cgraph_address_taken_from_non_vtable_p): Likewise.
* trans-mem.c (ipa_tm_execute): Update.
* simplify-rtx.c: Fix comment.
* rtl.c: Fix comment.
* symtab.c (symtab_unregister_node): Update.
* varpool.c (dump_varpool_node): Update.
(varpool_analyze_pending_decls): Update.
(assemble_aliases): Update.
(varpool_for_node_and_aliases): Update.
From-SVN: r186564
2012-04-18 11:57:53 +02:00
|
|
|
for (i = 0; ipa_ref_list_referring_iterate (&where->symbol.ref_list,
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
i, ref); i++)
|
2011-06-13 17:34:59 +02:00
|
|
|
if (ref->use == IPA_REF_ALIAS)
|
lto-symtab.c (lto_cgraph_replace_node): Update.
* lto-symtab.c (lto_cgraph_replace_node): Update.
* cgraphbuild.c (record_reference, record_type_list,
record_eh_tables, mark_address, mark_load, mark_store): Update.
* cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
Update.
* cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
(cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
* reload.c: Fix typo in comment.
* rtlanal.c: Likewise.
* tree-emultls.c (gen_emutls_addr): Update.
* ipa-reference.c (analyze_function): Update.
* cgraphunit.c (cgraph_analyze_function,
cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
Update.
* ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
(ipa_remove_reference): Likewise.
(ipa_remove_all_refering): Rename to ...
(ipa_remove_all_referring): ... this one; update.
(ipa_dump_references): Update.
(ipa_dump_referring): Update.
(ipa_clone_references): Update.
(ipa_clone_refering): Rename to ...
(ipa_clone_referring): ... this one; update.
(ipa_ref_cannot_lead_to_return): Update.
(ipa_ref_has_aliases_p): Update.
* ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
forward typedefs.
(ipa_ref_type): Remove.
(ipa_ref_ptr_u): Remove.
(ipa_ref): Remove referencing, refered, refered_index, refering_type
and refered_type; add referring, referred and referred_index.
(ipa_ref_list): Rename refering to referring.
(ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
ipa_clone_references, ipa_clone_referring): Update prototypes.
* lto-cgraph.c (referenced_from_other_partition_p): Update.
(lto_output_ref): Update.
(add_references): Update.
(input_varpool_node): Update.
(input_refs): Update.
* ipa-ref-inline.h (ipa_ref_node): Update.
(ipa_ref_varpool_node): Update.
(ipa_ref_referring_node); Update.
(ipa_ref_referring_varpool_node): Update.
(ipa_ref_referring_ref_list); Update.
(ipa_ref_referred_ref_list): Update.
(ipa_ref_list_first_referring): Update.
(ipa_empty_ref_list): Update.
(ipa_ref_list_refering_iterate): Rename to ...
(ipa_ref_list_referring_iterate): ... this one.
* cse.c: Update comment.
* ipa-utils.c (ipa_reverse_postorder): Update.
* tree-ssa-alias.c: Update.
* ipa-inline.c (reset_edge_caches): Update.
(update_caller_keys): Update.
* ipa-inline.h: Update comments.
* jump.c: Update comment.
* alias.c: Likewise.
* ipa.c (process_references): Update.
(cgraph_remove_unreachable_nodes): Likewise.
(ipa_discover_readonly_nonaddressable_var): Likewise.
(cgraph_address_taken_from_non_vtable_p): Likewise.
* trans-mem.c (ipa_tm_execute): Update.
* simplify-rtx.c: Fix comment.
* rtl.c: Fix comment.
* symtab.c (symtab_unregister_node): Update.
* varpool.c (dump_varpool_node): Update.
(varpool_analyze_pending_decls): Update.
(assemble_aliases): Update.
(varpool_for_node_and_aliases): Update.
From-SVN: r186564
2012-04-18 11:57:53 +02:00
|
|
|
reset_edge_caches (ipa_ref_referring_node (ref));
|
2011-05-05 00:48:54 +02:00
|
|
|
|
|
|
|
if (!e)
|
|
|
|
return;
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
if (!e->inline_failed && e->callee->callees)
|
|
|
|
e = e->callee->callees;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (e->inline_failed)
|
|
|
|
reset_edge_growth_cache (e);
|
|
|
|
if (e->next_callee)
|
|
|
|
e = e->next_callee;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
do
|
|
|
|
{
|
|
|
|
if (e->caller == node)
|
|
|
|
return;
|
|
|
|
e = e->caller->callers;
|
|
|
|
}
|
|
|
|
while (!e->next_callee);
|
|
|
|
e = e->next_callee;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Recompute HEAP nodes for each of caller of NODE.
|
|
|
|
UPDATED_NODES track nodes we already visited, to avoid redundant work.
|
|
|
|
When CHECK_INLINABLITY_FOR is set, re-check for specified edge that
|
|
|
|
it is inlinable. Otherwise check all edges. */
|
2005-05-25 14:34:01 +02:00
|
|
|
|
|
|
|
static void
|
|
|
|
update_caller_keys (fibheap_t heap, struct cgraph_node *node,
|
2011-05-05 00:48:54 +02:00
|
|
|
bitmap updated_nodes,
|
|
|
|
struct cgraph_edge *check_inlinablity_for)
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
|
|
|
struct cgraph_edge *edge;
|
2011-06-11 15:01:53 +02:00
|
|
|
int i;
|
|
|
|
struct ipa_ref *ref;
|
2005-05-25 14:34:01 +02:00
|
|
|
|
2011-06-13 17:34:59 +02:00
|
|
|
if ((!node->alias && !inline_summary (node)->inlinable)
|
2010-09-07 23:26:34 +02:00
|
|
|
|| cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE
|
2005-05-25 14:34:01 +02:00
|
|
|
|| node->global.inlined_to)
|
|
|
|
return;
|
2010-08-19 18:51:39 +02:00
|
|
|
if (!bitmap_set_bit (updated_nodes, node->uid))
|
2005-05-25 14:34:01 +02:00
|
|
|
return;
|
|
|
|
|
lto-symtab.c (lto_cgraph_replace_node): Update.
* lto-symtab.c (lto_cgraph_replace_node): Update.
* cgraphbuild.c (record_reference, record_type_list,
record_eh_tables, mark_address, mark_load, mark_store): Update.
* cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
Update.
* cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
(cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
* reload.c: Fix typo in comment.
* rtlanal.c: Likewise.
* tree-emultls.c (gen_emutls_addr): Update.
* ipa-reference.c (analyze_function): Update.
* cgraphunit.c (cgraph_analyze_function,
cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
Update.
* ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
(ipa_remove_reference): Likewise.
(ipa_remove_all_refering): Rename to ...
(ipa_remove_all_referring): ... this one; update.
(ipa_dump_references): Update.
(ipa_dump_referring): Update.
(ipa_clone_references): Update.
(ipa_clone_refering): Rename to ...
(ipa_clone_referring): ... this one; update.
(ipa_ref_cannot_lead_to_return): Update.
(ipa_ref_has_aliases_p): Update.
* ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
forward typedefs.
(ipa_ref_type): Remove.
(ipa_ref_ptr_u): Remove.
(ipa_ref): Remove referencing, refered, refered_index, refering_type
and refered_type; add referring, referred and referred_index.
(ipa_ref_list): Rename refering to referring.
(ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
ipa_clone_references, ipa_clone_referring): Update prototypes.
* lto-cgraph.c (referenced_from_other_partition_p): Update.
(lto_output_ref): Update.
(add_references): Update.
(input_varpool_node): Update.
(input_refs): Update.
* ipa-ref-inline.h (ipa_ref_node): Update.
(ipa_ref_varpool_node): Update.
(ipa_ref_referring_node); Update.
(ipa_ref_referring_varpool_node): Update.
(ipa_ref_referring_ref_list); Update.
(ipa_ref_referred_ref_list): Update.
(ipa_ref_list_first_referring): Update.
(ipa_empty_ref_list): Update.
(ipa_ref_list_refering_iterate): Rename to ...
(ipa_ref_list_referring_iterate): ... this one.
* cse.c: Update comment.
* ipa-utils.c (ipa_reverse_postorder): Update.
* tree-ssa-alias.c: Update.
* ipa-inline.c (reset_edge_caches): Update.
(update_caller_keys): Update.
* ipa-inline.h: Update comments.
* jump.c: Update comment.
* alias.c: Likewise.
* ipa.c (process_references): Update.
(cgraph_remove_unreachable_nodes): Likewise.
(ipa_discover_readonly_nonaddressable_var): Likewise.
(cgraph_address_taken_from_non_vtable_p): Likewise.
* trans-mem.c (ipa_tm_execute): Update.
* simplify-rtx.c: Fix comment.
* rtl.c: Fix comment.
* symtab.c (symtab_unregister_node): Update.
* varpool.c (dump_varpool_node): Update.
(varpool_analyze_pending_decls): Update.
(assemble_aliases): Update.
(varpool_for_node_and_aliases): Update.
From-SVN: r186564
2012-04-18 11:57:53 +02:00
|
|
|
for (i = 0; ipa_ref_list_referring_iterate (&node->symbol.ref_list,
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
i, ref); i++)
|
2011-06-11 15:01:53 +02:00
|
|
|
if (ref->use == IPA_REF_ALIAS)
|
|
|
|
{
|
lto-symtab.c (lto_cgraph_replace_node): Update.
* lto-symtab.c (lto_cgraph_replace_node): Update.
* cgraphbuild.c (record_reference, record_type_list,
record_eh_tables, mark_address, mark_load, mark_store): Update.
* cgraph.c (cgraph_same_body_alias, dump_cgraph_node,
cgraph_create_virtual_clone, cgraph_for_node_thunks_and_aliases):
Update.
* cgraph.h (symtab_node_def, symtab_node, const_symtab_node): Remove.
(cgraph_alias_aliased_node, varpool_alias_aliased_node): Update.
* reload.c: Fix typo in comment.
* rtlanal.c: Likewise.
* tree-emultls.c (gen_emutls_addr): Update.
* ipa-reference.c (analyze_function): Update.
* cgraphunit.c (cgraph_analyze_function,
cgraph_process_same_body_aliases, assemble_thunks_and_aliases):
Update.
* ipa-ref.c (ipa_record_reference): Reorg to avoid reference types.
(ipa_remove_reference): Likewise.
(ipa_remove_all_refering): Rename to ...
(ipa_remove_all_referring): ... this one; update.
(ipa_dump_references): Update.
(ipa_dump_referring): Update.
(ipa_clone_references): Update.
(ipa_clone_refering): Rename to ...
(ipa_clone_referring): ... this one; update.
(ipa_ref_cannot_lead_to_return): Update.
(ipa_ref_has_aliases_p): Update.
* ipa-ref.h (symtab_node_def, symtab_node, const_symtab_node): New
forward typedefs.
(ipa_ref_type): Remove.
(ipa_ref_ptr_u): Remove.
(ipa_ref): Remove referencing, refered, refered_index, refering_type
and refered_type; add referring, referred and referred_index.
(ipa_ref_list): Rename refering to referring.
(ipa_record_reference, ipa_remove_all_referring, ipa_dump_referring,
ipa_clone_references, ipa_clone_referring): Update prototypes.
* lto-cgraph.c (referenced_from_other_partition_p): Update.
(lto_output_ref): Update.
(add_references): Update.
(input_varpool_node): Update.
(input_refs): Update.
* ipa-ref-inline.h (ipa_ref_node): Update.
(ipa_ref_varpool_node): Update.
(ipa_ref_referring_node); Update.
(ipa_ref_referring_varpool_node): Update.
(ipa_ref_referring_ref_list); Update.
(ipa_ref_referred_ref_list): Update.
(ipa_ref_list_first_referring): Update.
(ipa_empty_ref_list): Update.
(ipa_ref_list_refering_iterate): Rename to ...
(ipa_ref_list_referring_iterate): ... this one.
* cse.c: Update comment.
* ipa-utils.c (ipa_reverse_postorder): Update.
* tree-ssa-alias.c: Update.
* ipa-inline.c (reset_edge_caches): Update.
(update_caller_keys): Update.
* ipa-inline.h: Update comments.
* jump.c: Update comment.
* alias.c: Likewise.
* ipa.c (process_references): Update.
(cgraph_remove_unreachable_nodes): Likewise.
(ipa_discover_readonly_nonaddressable_var): Likewise.
(cgraph_address_taken_from_non_vtable_p): Likewise.
* trans-mem.c (ipa_tm_execute): Update.
* simplify-rtx.c: Fix comment.
* rtl.c: Fix comment.
* symtab.c (symtab_unregister_node): Update.
* varpool.c (dump_varpool_node): Update.
(varpool_analyze_pending_decls): Update.
(assemble_aliases): Update.
(varpool_for_node_and_aliases): Update.
From-SVN: r186564
2012-04-18 11:57:53 +02:00
|
|
|
struct cgraph_node *alias = ipa_ref_referring_node (ref);
|
2011-06-11 15:01:53 +02:00
|
|
|
update_caller_keys (heap, alias, updated_nodes, check_inlinablity_for);
|
|
|
|
}
|
|
|
|
|
2010-05-27 19:07:21 +02:00
|
|
|
for (edge = node->callers; edge; edge = edge->next_caller)
|
2011-04-17 16:22:20 +02:00
|
|
|
if (edge->inline_failed)
|
|
|
|
{
|
2011-05-05 00:48:54 +02:00
|
|
|
if (!check_inlinablity_for
|
|
|
|
|| check_inlinablity_for == edge)
|
2006-07-24 13:23:21 +02:00
|
|
|
{
|
2011-05-05 00:48:54 +02:00
|
|
|
if (can_inline_edge_p (edge, false)
|
|
|
|
&& want_inline_small_function_p (edge, false))
|
|
|
|
update_edge_key (heap, edge);
|
|
|
|
else if (edge->aux)
|
|
|
|
{
|
|
|
|
report_inline_failed_reason (edge);
|
|
|
|
fibheap_delete_node (heap, (fibnode_t) edge->aux);
|
|
|
|
edge->aux = NULL;
|
|
|
|
}
|
2006-07-24 13:23:21 +02:00
|
|
|
}
|
2011-05-05 00:48:54 +02:00
|
|
|
else if (edge->aux)
|
|
|
|
update_edge_key (heap, edge);
|
2011-04-17 16:22:20 +02:00
|
|
|
}
|
2010-07-03 21:33:14 +02:00
|
|
|
}
|
|
|
|
|
2011-05-05 00:48:54 +02:00
|
|
|
/* Recompute HEAP nodes for each uninlined call in NODE.
|
2010-07-03 21:33:14 +02:00
|
|
|
This is used when we know that edge badnesses are going only to increase
|
|
|
|
(we introduced new call site) and thus all we need is to insert newly
|
|
|
|
created edges into heap. */
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_callee_keys (fibheap_t heap, struct cgraph_node *node,
|
|
|
|
bitmap updated_nodes)
|
|
|
|
{
|
|
|
|
struct cgraph_edge *e = node->callees;
|
2011-04-18 20:39:39 +02:00
|
|
|
|
2010-07-03 21:33:14 +02:00
|
|
|
if (!e)
|
|
|
|
return;
|
|
|
|
while (true)
|
|
|
|
if (!e->inline_failed && e->callee->callees)
|
|
|
|
e = e->callee->callees;
|
|
|
|
else
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
enum availability avail;
|
|
|
|
struct cgraph_node *callee;
|
2011-05-07 16:30:07 +02:00
|
|
|
/* We do not reset callee growth cache here. Since we added a new call,
|
|
|
|
growth chould have just increased and consequentely badness metric
|
|
|
|
don't need updating. */
|
2010-07-03 21:33:14 +02:00
|
|
|
if (e->inline_failed
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
&& (callee = cgraph_function_or_thunk_node (e->callee, &avail))
|
|
|
|
&& inline_summary (callee)->inlinable
|
|
|
|
&& cgraph_function_body_availability (callee) >= AVAIL_AVAILABLE
|
|
|
|
&& !bitmap_bit_p (updated_nodes, callee->uid))
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
2011-05-05 00:48:54 +02:00
|
|
|
if (can_inline_edge_p (e, false)
|
|
|
|
&& want_inline_small_function_p (e, false))
|
|
|
|
update_edge_key (heap, e);
|
|
|
|
else if (e->aux)
|
|
|
|
{
|
|
|
|
report_inline_failed_reason (e);
|
|
|
|
fibheap_delete_node (heap, (fibnode_t) e->aux);
|
|
|
|
e->aux = NULL;
|
|
|
|
}
|
2010-07-03 21:33:14 +02:00
|
|
|
}
|
|
|
|
if (e->next_callee)
|
|
|
|
e = e->next_callee;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
do
|
2010-04-13 20:22:35 +02:00
|
|
|
{
|
2010-07-03 21:33:14 +02:00
|
|
|
if (e->caller == node)
|
|
|
|
return;
|
|
|
|
e = e->caller->callers;
|
2010-04-13 20:22:35 +02:00
|
|
|
}
|
2010-07-03 21:33:14 +02:00
|
|
|
while (!e->next_callee);
|
|
|
|
e = e->next_callee;
|
2005-05-25 14:34:01 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Enqueue all recursive calls from NODE into priority queue depending on
|
c-common.c, [...]: Fix comment typos.
* c-common.c, c-parser.c, cfgbuild.c, cfghooks.c, cfghooks.h,
cfgrtl.c, cgraphunit.c, ddg.c, expr.h, gcse.c, ggc-page.c,
ggc-zone.c, gimplify.c, ipa-inline.c, longlong.h, targhooks.c,
tree-flow-inline.h, tree-pass.h, tree-ssa-dse.c,
tree-ssa-loop-im.c, tree-ssa-loop-ivopts.c,
tree-ssa-operands.c, tree-vect-analyze.c,
tree-vect-transform.c, tree-vectorizer.c, tree.c,
config/arm/arm.c, config/bfin/bfin.c, config/frv/frv.c,
config/frv/frv.md, config/i386/i386.c, config/i386/sse.md,
config/m68hc11/m68hc11.c, config/m68hc11/m68hc11.h,
config/mcore/mcore.c, config/mips/mips.c, config/mips/mips.md,
config/rs6000/darwin-ldouble.c, config/rs6000/rs6000.c,
config/rs6000/rs6000.h, config/sh/sh.c, config/sh/sh.md,
config/sh/ushmedia.h, config/sparc/sparc.c,
config/sparc/sparc.md, config/stormy16/stormy-abi: Fix comment
typos. Follow spelling conventions.
* doc/invoke.texi, doc/tm.texi, doc/tree-ssa.texi: Fix typos.
Follow spelling conventions.
From-SVN: r100218
2005-05-26 20:15:27 +02:00
|
|
|
how likely we want to recursively inline the call. */
|
2005-05-25 14:34:01 +02:00
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
static void
|
|
|
|
lookup_recursive_calls (struct cgraph_node *node, struct cgraph_node *where,
|
2005-05-25 14:34:01 +02:00
|
|
|
fibheap_t heap)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
|
|
|
struct cgraph_edge *e;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
enum availability avail;
|
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
for (e = where->callees; e; e = e->next_callee)
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
if (e->callee == node
|
|
|
|
|| (cgraph_function_or_thunk_node (e->callee, &avail) == node
|
|
|
|
&& avail > AVAIL_OVERWRITABLE))
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2005-07-28 23:45:27 +02:00
|
|
|
/* When profile feedback is available, prioritize by expected number
|
2011-04-18 20:39:39 +02:00
|
|
|
of calls. */
|
2005-07-28 23:45:27 +02:00
|
|
|
fibheap_insert (heap,
|
2011-04-18 20:39:39 +02:00
|
|
|
!max_count ? -e->frequency
|
2005-07-28 23:45:27 +02:00
|
|
|
: -(e->count / ((max_count + (1<<24) - 1) / (1<<24))),
|
|
|
|
e);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
for (e = where->callees; e; e = e->next_callee)
|
|
|
|
if (!e->inline_failed)
|
2005-05-25 14:34:01 +02:00
|
|
|
lookup_recursive_calls (node, e->callee, heap);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Decide on recursive inlining: in the case function has recursive calls,
|
2008-07-23 21:45:45 +02:00
|
|
|
inline until body size reaches given argument. If any new indirect edges
|
2008-09-09 21:19:41 +02:00
|
|
|
are discovered in the process, add them to *NEW_EDGES, unless NEW_EDGES
|
|
|
|
is NULL. */
|
2005-05-25 14:34:01 +02:00
|
|
|
|
|
|
|
static bool
|
2011-04-17 16:22:20 +02:00
|
|
|
recursive_inlining (struct cgraph_edge *edge,
|
|
|
|
VEC (cgraph_edge_p, heap) **new_edges)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
|
|
|
int limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE_AUTO);
|
2005-05-25 14:34:01 +02:00
|
|
|
fibheap_t heap;
|
2011-04-06 10:51:23 +02:00
|
|
|
struct cgraph_node *node;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
struct cgraph_edge *e;
|
2011-04-17 16:22:20 +02:00
|
|
|
struct cgraph_node *master_clone = NULL, *next;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
int depth = 0;
|
|
|
|
int n = 0;
|
|
|
|
|
2011-04-06 10:51:23 +02:00
|
|
|
node = edge->caller;
|
|
|
|
if (node->global.inlined_to)
|
|
|
|
node = node->global.inlined_to;
|
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (DECL_DECLARED_INLINE_P (node->symbol.decl))
|
2011-04-17 16:22:20 +02:00
|
|
|
limit = PARAM_VALUE (PARAM_MAX_INLINE_INSNS_RECURSIVE);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
/* Make sure that function is small enough to be considered for inlining. */
|
2011-04-17 16:22:20 +02:00
|
|
|
if (estimate_size_after_inlining (node, edge) >= limit)
|
2005-05-25 14:34:01 +02:00
|
|
|
return false;
|
|
|
|
heap = fibheap_new ();
|
|
|
|
lookup_recursive_calls (node, node, heap);
|
|
|
|
if (fibheap_empty (heap))
|
|
|
|
{
|
|
|
|
fibheap_delete (heap);
|
|
|
|
return false;
|
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
if (dump_file)
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2005-05-25 14:34:01 +02:00
|
|
|
" Performing recursive inlining on %s\n",
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
cgraph_node_name (node));
|
|
|
|
|
|
|
|
/* Do the inlining and update list of recursive call during process. */
|
2011-04-06 10:51:23 +02:00
|
|
|
while (!fibheap_empty (heap))
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2007-06-30 12:52:30 +02:00
|
|
|
struct cgraph_edge *curr
|
|
|
|
= (struct cgraph_edge *) fibheap_extract_min (heap);
|
2012-10-25 14:23:08 +02:00
|
|
|
struct cgraph_node *cnode, *dest = curr->callee;
|
2011-04-06 10:51:23 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!can_inline_edge_p (curr, true))
|
|
|
|
continue;
|
|
|
|
|
2012-10-25 14:23:08 +02:00
|
|
|
/* MASTER_CLONE is produced in the case we already started modified
|
|
|
|
the function. Be sure to redirect edge to the original body before
|
|
|
|
estimating growths otherwise we will be seeing growths after inlining
|
|
|
|
the already modified body. */
|
|
|
|
if (master_clone)
|
|
|
|
{
|
|
|
|
cgraph_redirect_edge_callee (curr, master_clone);
|
|
|
|
reset_edge_growth_cache (curr);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (estimate_size_after_inlining (node, curr) > limit)
|
|
|
|
{
|
|
|
|
cgraph_redirect_edge_callee (curr, dest);
|
|
|
|
reset_edge_growth_cache (curr);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2005-07-28 23:45:27 +02:00
|
|
|
depth = 1;
|
|
|
|
for (cnode = curr->caller;
|
|
|
|
cnode->global.inlined_to; cnode = cnode->callers->caller)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (node->symbol.decl
|
|
|
|
== cgraph_function_or_thunk_node (curr->callee, NULL)->symbol.decl)
|
2011-08-05 22:20:07 +02:00
|
|
|
depth++;
|
2005-07-28 23:45:27 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!want_inline_self_recursive_call_p (curr, node, false, depth))
|
2012-10-25 14:23:08 +02:00
|
|
|
{
|
|
|
|
cgraph_redirect_edge_callee (curr, dest);
|
|
|
|
reset_edge_growth_cache (curr);
|
|
|
|
continue;
|
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2005-05-25 14:34:01 +02:00
|
|
|
if (dump_file)
|
2005-07-28 23:45:27 +02:00
|
|
|
{
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2005-07-28 23:45:27 +02:00
|
|
|
" Inlining call of depth %i", depth);
|
|
|
|
if (node->count)
|
|
|
|
{
|
|
|
|
fprintf (dump_file, " called approx. %.2f times per call",
|
|
|
|
(double)curr->count / node->count);
|
|
|
|
}
|
|
|
|
fprintf (dump_file, "\n");
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!master_clone)
|
|
|
|
{
|
|
|
|
/* We need original clone to copy around. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
master_clone = cgraph_clone_node (node, node->symbol.decl,
|
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraphbuild.c (build_cgraph_edges): Update call
of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraph.c (cgraph_create_edge_including_clones,
cgraph_create_edge_1, cgraph_allocate_init_indirect_info,
cgraph_update_edges_for_call_stmt_node): Do not take nest
argument; do not initialize call_stmt_size/time.
(dump_cgraph_node): Do not dump nest.
(cgraph_clone_edge): Do not take loop_nest argument;
do not propagate it; do not clone call_stmt_size/time.
(cgraph_clone_node): Likewise.
(cgraph_create_virtual_clone): Update.
* cgraph.h (struct cgraph_edge): Remove
call_stmt_size/call_stmt_time/loop_nest.
(cgraph_create_edge, cgraph_create_indirect_edge,
cgraph_create_edge_including_clones, cgraph_clone_node): Update
prototype.
* tree-emutls.c (gen_emutls_addr): Update.
* ipa-inline-transform.c (update_noncloned_frequencies): Do not handle
loop_nest; handle indirect calls, too.
(clone_inlined_nodes): Do not care about updating inline summaries.
* cgraphunit.c (cgraph_copy_node_for_versioning): Update.
* lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not
stream call_stmt_size/call_stmt_time/loop_nest.
* ipa-inline.c (edge_badness): Update.
(ipa_inline): dump summaries after inlining.
* ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t):
new.
(inline_edge_summary): New function.
* ipa-inline-analysis.c (edge_duplication_hook_holder): New holder.
(inline_edge_removal_hook): Handle edge summaries.
(inline_edge_duplication_hook): New hook.
(inline_summary_alloc): Alloc hooks.
(initialize_growth_caches): Do not register removal hooks.
(free_growth_caches); Do not free removal hook.
(dump_inline_edge_summary): New function.
(dump_inline_summary): Use it.
(estimate_function_body_sizes, estimate_edge_size_and_time): Update.
(inline_update_callee_summaries): New function.
(inline_merge_summary): Use it.
(do_estimate_edge_time, do_estimate_edge_growth): Update.
(read_inline_edge_summary): New function.
(inline_read_section): Use it.
(write_inline_edge_summary): New function.
(inline_write_summary): Use it.
(inline_free_summary): Free edge new holders.
* tree-inline.c (copy_bb): Update.
From-SVN: r172989
2011-04-27 00:05:50 +02:00
|
|
|
node->count, CGRAPH_FREQ_BASE,
|
2011-05-08 21:14:24 +02:00
|
|
|
false, NULL, true);
|
2011-04-17 16:22:20 +02:00
|
|
|
for (e = master_clone->callees; e; e = e->next_callee)
|
|
|
|
if (!e->inline_failed)
|
2011-04-20 00:28:54 +02:00
|
|
|
clone_inlined_nodes (e, true, false, NULL);
|
2012-10-25 14:23:08 +02:00
|
|
|
cgraph_redirect_edge_callee (curr, master_clone);
|
|
|
|
reset_edge_growth_cache (curr);
|
2011-04-17 16:22:20 +02:00
|
|
|
}
|
|
|
|
|
2012-08-10 09:52:23 +02:00
|
|
|
inline_call (curr, false, new_edges, &overall_size, true);
|
2005-05-25 14:34:01 +02:00
|
|
|
lookup_recursive_calls (node, curr->callee, heap);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
n++;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
|
2005-07-28 23:45:27 +02:00
|
|
|
if (!fibheap_empty (heap) && dump_file)
|
|
|
|
fprintf (dump_file, " Recursive inlining growth limit met.\n");
|
2005-05-25 14:34:01 +02:00
|
|
|
fibheap_delete (heap);
|
2011-04-17 16:22:20 +02:00
|
|
|
|
|
|
|
if (!master_clone)
|
|
|
|
return false;
|
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
if (dump_file)
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2011-04-17 16:22:20 +02:00
|
|
|
"\n Inlined %i times, "
|
|
|
|
"body grown from size %i to %i, time %i to %i\n", n,
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
inline_summary (master_clone)->size, inline_summary (node)->size,
|
|
|
|
inline_summary (master_clone)->time, inline_summary (node)->time);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
/* Remove master clone we used for inlining. We rely that clones inlined
|
|
|
|
into master clone gets queued just before master clone so we don't
|
|
|
|
need recursion. */
|
cgraph.h (symtab_node_base): Add next and previous pointers.
* cgraph.h (symtab_node_base): Add next and previous pointers.
(cgraph_node): Remove next and preivous pointers.
(varpool_node): Likewise; remove next/previous GTY marker;
it is not type safe.
(symtab_node_def): Update GTY marker
(x_cgraph_nodes, cgraph_nodes): Remove.
(symtab_nodes): New function.
(cgraph_order): Rename to ...
(symtab_order): ... this one.
(symtab_register_node, symtab_unregister_node, symtab_remove_node):
Declare.
(x_varpool_nodes, varpool_nodes): Remove.
(FOR_EACH_STATIC_VARIABLE): Update.
(symtab_function_p, symtab_variable_p): New function.
(FOR_EACH_VARIABLE): Update.
(varpool_first_variable, varpool_next_variable): New functions.
(FOR_EACH_VARIABLE): Update.
(cgraph_first_defined_function): Update.
(cgraph_next_defined_function, cgraph_next_defined_function): Update.
(FOR_EACH_DEFINED_FUNCTION, FOR_EACH_FUNCTION): Update.
(cgraph_first_function, cgraph_next_function): New.
(FOR_EACH_FUNCTION): Update.
(cgraph_first_function_with_gimple_body,
cgraph_next_function_with_gimple_body): Update.
* symtab.c: New file.
* cgraph.c: Update copyright dates.
(x_cgraph_nodes, cgraph_order): Remove.
(NEXT_FREE_NODE): Update.
(SET_NEXT_FREE_NODE): New.
(cgraph_create_node_1): Remove common code.
(cgraph_create_node); Remove common code; call symtab_register_node.
(cgraph_remove_node): Remove common code; call symtab_unregister-node.
(cgraph_add_asm_node); update.
(cgraph_clone_node): Register new node.
* cgraphunit.c (process_function_and_variable_attributes): Update.
(cgraph_analyze_functions): Update.
(cgraph_analyze_functions): Update.
(cgraph_output_in_order): Update.
* lto-cgraph.c (input_node, input_varpool_node, input_cgraph_1): Update.
* ipa-inline.c (recursive_inlining); update.
* lto-streamer-in.c (lto_input_toplevel_asms); Update.
* ipa.c (cgraph_remove_unreachable_nodes): Update.
* Makefile.in: Add symtab.o
* varpool.c (x_varpool_nodes): Remove
(varpool_node): Remove common code; call symtab_register_node.
(varpool_remove_node); Remove common code; call symtab_unregister_node.
From-SVN: r186496
2012-04-16 16:34:22 +02:00
|
|
|
for (node = cgraph_first_function (); node != master_clone;
|
2006-07-26 22:17:32 +02:00
|
|
|
node = next)
|
|
|
|
{
|
cgraph.h (symtab_node_base): Add next and previous pointers.
* cgraph.h (symtab_node_base): Add next and previous pointers.
(cgraph_node): Remove next and preivous pointers.
(varpool_node): Likewise; remove next/previous GTY marker;
it is not type safe.
(symtab_node_def): Update GTY marker
(x_cgraph_nodes, cgraph_nodes): Remove.
(symtab_nodes): New function.
(cgraph_order): Rename to ...
(symtab_order): ... this one.
(symtab_register_node, symtab_unregister_node, symtab_remove_node):
Declare.
(x_varpool_nodes, varpool_nodes): Remove.
(FOR_EACH_STATIC_VARIABLE): Update.
(symtab_function_p, symtab_variable_p): New function.
(FOR_EACH_VARIABLE): Update.
(varpool_first_variable, varpool_next_variable): New functions.
(FOR_EACH_VARIABLE): Update.
(cgraph_first_defined_function): Update.
(cgraph_next_defined_function, cgraph_next_defined_function): Update.
(FOR_EACH_DEFINED_FUNCTION, FOR_EACH_FUNCTION): Update.
(cgraph_first_function, cgraph_next_function): New.
(FOR_EACH_FUNCTION): Update.
(cgraph_first_function_with_gimple_body,
cgraph_next_function_with_gimple_body): Update.
* symtab.c: New file.
* cgraph.c: Update copyright dates.
(x_cgraph_nodes, cgraph_order): Remove.
(NEXT_FREE_NODE): Update.
(SET_NEXT_FREE_NODE): New.
(cgraph_create_node_1): Remove common code.
(cgraph_create_node); Remove common code; call symtab_register_node.
(cgraph_remove_node): Remove common code; call symtab_unregister-node.
(cgraph_add_asm_node); update.
(cgraph_clone_node): Register new node.
* cgraphunit.c (process_function_and_variable_attributes): Update.
(cgraph_analyze_functions): Update.
(cgraph_analyze_functions): Update.
(cgraph_output_in_order): Update.
* lto-cgraph.c (input_node, input_varpool_node, input_cgraph_1): Update.
* ipa-inline.c (recursive_inlining); update.
* lto-streamer-in.c (lto_input_toplevel_asms); Update.
* ipa.c (cgraph_remove_unreachable_nodes): Update.
* Makefile.in: Add symtab.o
* varpool.c (x_varpool_nodes): Remove
(varpool_node): Remove common code; call symtab_register_node.
(varpool_remove_node); Remove common code; call symtab_unregister_node.
From-SVN: r186496
2012-04-16 16:34:22 +02:00
|
|
|
next = cgraph_next_function (node);
|
2006-07-26 22:17:32 +02:00
|
|
|
if (node->global.inlined_to == master_clone)
|
|
|
|
cgraph_remove_node (node);
|
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
cgraph_remove_node (master_clone);
|
2011-04-17 16:22:20 +02:00
|
|
|
return true;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
|
cgraphunit.c, [...]: Fix comment typos.
* cgraphunit.c, config/arm/arm.c, config/m68k/m68k.c,
ipa-inline.c, tree-profile.c, tree-ssa-live.c,
tree-ssa-math-opts.c, tree-ssanames.c, tree-vect-analyze.c,
value-prof.c: Fix comment typos.
From-SVN: r121374
2007-01-31 04:45:38 +01:00
|
|
|
/* Given whole compilation unit estimate of INSNS, compute how large we can
|
2007-01-24 23:45:00 +01:00
|
|
|
allow the unit to grow. */
|
2011-04-18 20:39:39 +02:00
|
|
|
|
2007-01-24 23:45:00 +01:00
|
|
|
static int
|
|
|
|
compute_max_insns (int insns)
|
|
|
|
{
|
|
|
|
int max_insns = insns;
|
|
|
|
if (max_insns < PARAM_VALUE (PARAM_LARGE_UNIT_INSNS))
|
|
|
|
max_insns = PARAM_VALUE (PARAM_LARGE_UNIT_INSNS);
|
|
|
|
|
2007-01-24 23:45:34 +01:00
|
|
|
return ((HOST_WIDEST_INT) max_insns
|
|
|
|
* (100 + PARAM_VALUE (PARAM_INLINE_UNIT_GROWTH)) / 100);
|
2007-01-24 23:45:00 +01:00
|
|
|
}
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
|
2008-07-23 21:45:45 +02:00
|
|
|
/* Compute badness of all edges in NEW_EDGES and add them to the HEAP. */
|
2011-04-18 20:39:39 +02:00
|
|
|
|
2008-07-23 21:45:45 +02:00
|
|
|
static void
|
|
|
|
add_new_edges_to_heap (fibheap_t heap, VEC (cgraph_edge_p, heap) *new_edges)
|
|
|
|
{
|
|
|
|
while (VEC_length (cgraph_edge_p, new_edges) > 0)
|
|
|
|
{
|
|
|
|
struct cgraph_edge *edge = VEC_pop (cgraph_edge_p, new_edges);
|
|
|
|
|
|
|
|
gcc_assert (!edge->aux);
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
if (edge->inline_failed
|
2011-04-17 16:22:20 +02:00
|
|
|
&& can_inline_edge_p (edge, true)
|
|
|
|
&& want_inline_small_function_p (edge, true))
|
|
|
|
edge->aux = fibheap_insert (heap, edge_badness (edge, false), edge);
|
2008-07-23 21:45:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
/* We use greedy algorithm for inlining of small functions:
|
2011-04-18 20:39:39 +02:00
|
|
|
All inline candidates are put into prioritized heap ordered in
|
|
|
|
increasing badness.
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
The inlining of small functions is bounded by unit growth parameters. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
static void
|
2011-04-17 16:22:20 +02:00
|
|
|
inline_small_functions (void)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
|
|
|
struct cgraph_node *node;
|
2005-05-25 14:34:01 +02:00
|
|
|
struct cgraph_edge *edge;
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
fibheap_t edge_heap = fibheap_new ();
|
2005-05-25 14:34:01 +02:00
|
|
|
bitmap updated_nodes = BITMAP_ALLOC (NULL);
|
2009-05-25 23:59:24 +02:00
|
|
|
int min_size, max_size;
|
2008-07-23 21:45:45 +02:00
|
|
|
VEC (cgraph_edge_p, heap) *new_indirect_edges = NULL;
|
2011-04-18 20:39:39 +02:00
|
|
|
int initial_size = 0;
|
2012-10-28 10:58:38 +01:00
|
|
|
struct cgraph_node **order = XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
|
2008-07-23 21:45:45 +02:00
|
|
|
|
2009-11-18 15:10:02 +01:00
|
|
|
if (flag_indirect_inlining)
|
2008-07-23 21:45:45 +02:00
|
|
|
new_indirect_edges = VEC_alloc (cgraph_edge_p, heap, 8);
|
2005-05-25 14:34:01 +02:00
|
|
|
|
2011-04-20 03:04:51 +02:00
|
|
|
/* Compute overall unit size and other global parameters used by badness
|
|
|
|
metrics. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
max_count = 0;
|
2012-10-28 10:58:38 +01:00
|
|
|
ipa_reduced_postorder (order, true, true, NULL);
|
|
|
|
free (order);
|
2011-04-20 03:04:51 +02:00
|
|
|
|
2011-05-07 01:00:49 +02:00
|
|
|
FOR_EACH_DEFINED_FUNCTION (node)
|
|
|
|
if (!node->global.inlined_to)
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
{
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
if (cgraph_function_with_gimple_body_p (node)
|
|
|
|
|| node->thunk.thunk_p)
|
|
|
|
{
|
|
|
|
struct inline_summary *info = inline_summary (node);
|
2012-10-28 10:50:58 +01:00
|
|
|
struct ipa_dfs_info *dfs = (struct ipa_dfs_info *) node->symbol.aux;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (!DECL_EXTERNAL (node->symbol.decl))
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
initial_size += info->size;
|
2012-10-28 13:00:32 +01:00
|
|
|
if (dfs && dfs->next_cycle)
|
|
|
|
{
|
|
|
|
struct cgraph_node *n2;
|
|
|
|
int id = dfs->scc_no + 1;
|
|
|
|
for (n2 = node; n2;
|
|
|
|
n2 = ((struct ipa_dfs_info *) node->symbol.aux)->next_cycle)
|
|
|
|
{
|
|
|
|
struct inline_summary *info2 = inline_summary (n2);
|
|
|
|
if (info2->scc_no)
|
|
|
|
break;
|
|
|
|
info2->scc_no = id;
|
|
|
|
}
|
|
|
|
}
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
}
|
2011-04-18 20:39:39 +02:00
|
|
|
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
for (edge = node->callers; edge; edge = edge->next_caller)
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
if (max_count < edge->count)
|
|
|
|
max_count = edge->count;
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
}
|
2012-10-28 10:50:58 +01:00
|
|
|
ipa_free_postorder_info ();
|
|
|
|
initialize_growth_caches ();
|
|
|
|
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file,
|
|
|
|
"\nDeciding on inlining of small functions. Starting with size %i.\n",
|
|
|
|
initial_size);
|
2007-01-24 23:45:00 +01:00
|
|
|
|
2011-04-18 20:52:22 +02:00
|
|
|
overall_size = initial_size;
|
2009-05-25 23:59:24 +02:00
|
|
|
max_size = compute_max_insns (overall_size);
|
|
|
|
min_size = overall_size;
|
2011-04-20 03:04:51 +02:00
|
|
|
|
|
|
|
/* Populate the heeap with all edges we might inline. */
|
|
|
|
|
2011-05-07 01:00:49 +02:00
|
|
|
FOR_EACH_DEFINED_FUNCTION (node)
|
|
|
|
if (!node->global.inlined_to)
|
2011-04-20 03:04:51 +02:00
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, "Enqueueing calls of %s/%i.\n",
|
|
|
|
cgraph_node_name (node), node->uid);
|
|
|
|
|
|
|
|
for (edge = node->callers; edge; edge = edge->next_caller)
|
|
|
|
if (edge->inline_failed
|
|
|
|
&& can_inline_edge_p (edge, true)
|
|
|
|
&& want_inline_small_function_p (edge, true)
|
|
|
|
&& edge->inline_failed)
|
|
|
|
{
|
|
|
|
gcc_assert (!edge->aux);
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
update_edge_key (edge_heap, edge);
|
2011-04-20 03:04:51 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
gcc_assert (in_lto_p
|
|
|
|
|| !max_count
|
|
|
|
|| (profile_info && flag_branch_probabilities));
|
2007-01-24 23:45:00 +01:00
|
|
|
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
while (!fibheap_empty (edge_heap))
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2009-05-25 23:59:24 +02:00
|
|
|
int old_size = overall_size;
|
2010-04-13 20:22:35 +02:00
|
|
|
struct cgraph_node *where, *callee;
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
int badness = fibheap_min_key (edge_heap);
|
2010-05-27 19:07:21 +02:00
|
|
|
int current_badness;
|
2011-10-20 13:46:08 +02:00
|
|
|
int cached_badness;
|
2010-04-13 20:22:35 +02:00
|
|
|
int growth;
|
2005-05-25 14:34:01 +02:00
|
|
|
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
edge = (struct cgraph_edge *) fibheap_extract_min (edge_heap);
|
2010-04-13 20:22:35 +02:00
|
|
|
gcc_assert (edge->aux);
|
|
|
|
edge->aux = NULL;
|
|
|
|
if (!edge->inline_failed)
|
|
|
|
continue;
|
2010-05-27 19:07:21 +02:00
|
|
|
|
2011-10-20 13:46:08 +02:00
|
|
|
/* Be sure that caches are maintained consistent.
|
2012-05-29 16:14:06 +02:00
|
|
|
We can not make this ENABLE_CHECKING only because it cause different
|
2011-10-20 13:46:08 +02:00
|
|
|
updates of the fibheap queue. */
|
|
|
|
cached_badness = edge_badness (edge, false);
|
2011-05-05 00:48:54 +02:00
|
|
|
reset_edge_growth_cache (edge);
|
|
|
|
reset_node_growth_cache (edge->callee);
|
|
|
|
|
2010-05-27 19:07:21 +02:00
|
|
|
/* When updating the edge costs, we only decrease badness in the keys.
|
2011-04-18 20:39:39 +02:00
|
|
|
Increases of badness are handled lazilly; when we see key with out
|
|
|
|
of date value on it, we re-insert it now. */
|
2011-04-17 16:22:20 +02:00
|
|
|
current_badness = edge_badness (edge, false);
|
2011-10-20 13:46:08 +02:00
|
|
|
gcc_assert (cached_badness == current_badness);
|
2010-05-27 19:07:21 +02:00
|
|
|
gcc_assert (current_badness >= badness);
|
|
|
|
if (current_badness != badness)
|
|
|
|
{
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
edge->aux = fibheap_insert (edge_heap, current_badness, edge);
|
2010-05-27 19:07:21 +02:00
|
|
|
continue;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
|
|
|
|
if (!can_inline_edge_p (edge, true))
|
|
|
|
continue;
|
2010-05-27 19:07:21 +02:00
|
|
|
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
callee = cgraph_function_or_thunk_node (edge->callee, NULL);
|
2011-04-13 19:26:50 +02:00
|
|
|
growth = estimate_edge_growth (edge);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
if (dump_file)
|
|
|
|
{
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2009-05-25 23:59:24 +02:00
|
|
|
"\nConsidering %s with %i size\n",
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
cgraph_node_name (callee),
|
|
|
|
inline_summary (callee)->size);
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2009-04-13 23:29:01 +02:00
|
|
|
" to be inlined into %s in %s:%i\n"
|
2011-04-17 16:22:20 +02:00
|
|
|
" Estimated growth after inlined into all is %+i insns.\n"
|
2007-02-09 23:49:30 +01:00
|
|
|
" Estimated badness is %i, frequency %.2f.\n",
|
2005-05-25 14:34:01 +02:00
|
|
|
cgraph_node_name (edge->caller),
|
2010-04-21 16:38:38 +02:00
|
|
|
flag_wpa ? "unknown"
|
|
|
|
: gimple_filename ((const_gimple) edge->call_stmt),
|
2011-04-17 16:22:20 +02:00
|
|
|
flag_wpa ? -1
|
|
|
|
: gimple_lineno ((const_gimple) edge->call_stmt),
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
estimate_growth (callee),
|
2010-04-13 20:22:35 +02:00
|
|
|
badness,
|
2007-02-09 23:49:30 +01:00
|
|
|
edge->frequency / (double)CGRAPH_FREQ_BASE);
|
2005-05-25 14:34:01 +02:00
|
|
|
if (edge->count)
|
2011-04-17 16:22:20 +02:00
|
|
|
fprintf (dump_file," Called "HOST_WIDEST_INT_PRINT_DEC"x\n",
|
|
|
|
edge->count);
|
2010-04-13 20:22:35 +02:00
|
|
|
if (dump_flags & TDF_DETAILS)
|
2011-04-17 16:22:20 +02:00
|
|
|
edge_badness (edge, true);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (overall_size + growth > max_size
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
&& !DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
edge->inline_failed = CIF_INLINE_UNIT_GROWTH_LIMIT;
|
|
|
|
report_inline_failed_reason (edge);
|
2005-05-25 14:34:01 +02:00
|
|
|
continue;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
|
|
|
|
if (!want_inline_small_function_p (edge, true))
|
2011-04-18 20:39:39 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Heuristics for inlining small functions works poorly for
|
|
|
|
recursive calls where we do efect similar to loop unrolling.
|
|
|
|
When inliing such edge seems profitable, leave decision on
|
|
|
|
specific inliner. */
|
2011-04-06 10:51:23 +02:00
|
|
|
if (cgraph_edge_recursive_p (edge))
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
|
|
|
where = edge->caller;
|
|
|
|
if (where->global.inlined_to)
|
|
|
|
where = where->global.inlined_to;
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!recursive_inlining (edge,
|
|
|
|
flag_indirect_inlining
|
|
|
|
? &new_indirect_edges : NULL))
|
2011-04-06 10:51:23 +02:00
|
|
|
{
|
|
|
|
edge->inline_failed = CIF_RECURSIVE_INLINING;
|
|
|
|
continue;
|
|
|
|
}
|
2011-05-05 00:48:54 +02:00
|
|
|
reset_edge_caches (where);
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Recursive inliner inlines all recursive calls of the function
|
|
|
|
at once. Consequently we need to update all callee keys. */
|
2009-11-18 15:10:02 +01:00
|
|
|
if (flag_indirect_inlining)
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
add_new_edges_to_heap (edge_heap, new_indirect_edges);
|
|
|
|
update_callee_keys (edge_heap, where, updated_nodes);
|
2005-05-25 14:34:01 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-04-17 16:22:20 +02:00
|
|
|
struct cgraph_node *outer_node = NULL;
|
|
|
|
int depth = 0;
|
|
|
|
|
|
|
|
/* Consider the case where self recursive function A is inlined into B.
|
|
|
|
This is desired optimization in some cases, since it leads to effect
|
|
|
|
similar of loop peeling and we might completely optimize out the
|
|
|
|
recursive call. However we must be extra selective. */
|
|
|
|
|
|
|
|
where = edge->caller;
|
|
|
|
while (where->global.inlined_to)
|
2005-05-25 14:34:01 +02:00
|
|
|
{
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (where->symbol.decl == callee->symbol.decl)
|
2011-04-17 16:22:20 +02:00
|
|
|
outer_node = where, depth++;
|
|
|
|
where = where->callers->caller;
|
|
|
|
}
|
|
|
|
if (outer_node
|
|
|
|
&& !want_inline_self_recursive_call_p (edge, outer_node,
|
|
|
|
true, depth))
|
|
|
|
{
|
|
|
|
edge->inline_failed
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
= (DECL_DISREGARD_INLINE_LIMITS (edge->callee->symbol.decl)
|
2011-04-17 16:22:20 +02:00
|
|
|
? CIF_RECURSIVE_INLINING : CIF_UNSPECIFIED);
|
2005-05-25 14:34:01 +02:00
|
|
|
continue;
|
|
|
|
}
|
2011-04-17 16:22:20 +02:00
|
|
|
else if (depth && dump_file)
|
|
|
|
fprintf (dump_file, " Peeling recursion with depth %i\n", depth);
|
|
|
|
|
2010-07-03 21:33:14 +02:00
|
|
|
gcc_checking_assert (!callee->global.inlined_to);
|
2012-08-10 09:52:23 +02:00
|
|
|
inline_call (edge, true, &new_indirect_edges, &overall_size, true);
|
2009-11-18 15:10:02 +01:00
|
|
|
if (flag_indirect_inlining)
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
add_new_edges_to_heap (edge_heap, new_indirect_edges);
|
ipa-prop.h (struct ipa_param_flags): Removed.
2008-09-11 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_param_flags): Removed.
(struct ipa_param_descriptor): New structure.
(struct ipa_node_params): ipcp_lattices, param_decls and
param_flags moved to ipa_param_description.
(ipa_get_ith_param): Renamed to ipa_get_param, changed to access
descriptors. Renamed all users.
(ipa_is_ith_param_modified): Renamed to ipa_is_param_modified,
changed to access descriptors. Renamed all users.
(ipa_is_ith_param_called): Renamed to ipa_is_param_called, changed
to access descriptors. Renamed all users.
* ipa-cp.c (ipcp_init_cloned_node): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
(ipcp_analyze_node): Likewise.
(ipcp_get_ith_lattice): Renamed to ipcp_get_lattice, changed to access
descriptors. Renamed all users.
(ipcp_initialize_node_lattices): Remove allocation.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
* ipa-prop.c (ipa_create_param_decls_array): Renamed to
ipa_populate_param_decls, made static, added parameter info,
renamed mt to node, removed allocation, changed to use
descriptors.
(ipa_count_formal_params): Made static, added parameter info,
renamed mt to node.
(ipa_initialize_node_params): New function.
(ipa_check_stmt_modifications): Changed to use descriptors.
(ipa_detect_param_modifications): Removed allocation, changed to
use descriptors.
(ipa_note_param_call): Changed to use descriptors.
(ipa_analyze_params_uses): Removed allocation.
(ipa_free_node_params_substructures): Changed to use descriptors.
(ipa_edge_duplication_hook): Use the unused attribute.
(ipa_node_duplication_hook): Use the unused attribute, changed to
use descriptors, changed to duplicate descriptors.
* ipa-inline.c (cgraph_mark_inline_edge): New parameter new_edges,
changed all callers. Call ipa_propagate_indirect_call_infos if doing
indirect inlining. Made static.
(cgraph_decide_inlining): Freeing ipa-prop structures after inlining
functions called only once.
(cgraph_decide_recursive_inlining): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining_of_small_functions): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining): Don't call
ipa_propagate_indirect_call_infos.
* ipa-prop.c: Check that vectors are allocated.
* ipa-inline.c (cgraph_mark_inline_edge): Returns boolean, true
iff a new cgraph edges have been created.
(cgraph_decide_inlining): New variable redo_always_inline.
Flattening and always_inlining loop until callgraph stabilizes.
* ipa-prop.c (update_call_notes_after_inlining): Returns boolean,
true iff new cgraph edges have been created.
(propagate_info_to_inlined_callees): Likewise.
(ipa_propagate_indirect_call_infos): Likewise.
From-SVN: r140293
2008-09-11 19:03:23 +02:00
|
|
|
|
2011-05-05 00:48:54 +02:00
|
|
|
reset_edge_caches (edge->callee);
|
|
|
|
reset_node_growth_cache (callee);
|
|
|
|
|
2012-10-28 10:50:58 +01:00
|
|
|
update_callee_keys (edge_heap, where, updated_nodes);
|
2005-05-25 14:34:01 +02:00
|
|
|
}
|
|
|
|
where = edge->caller;
|
|
|
|
if (where->global.inlined_to)
|
|
|
|
where = where->global.inlined_to;
|
|
|
|
|
|
|
|
/* Our profitability metric can depend on local properties
|
|
|
|
such as number of inlinable calls and size of the function body.
|
|
|
|
After inlining these properties might change for the function we
|
|
|
|
inlined into (since it's body size changed) and for the functions
|
|
|
|
called by function we inlined (since number of it inlinable callers
|
|
|
|
might change). */
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
update_caller_keys (edge_heap, where, updated_nodes, NULL);
|
2005-05-25 14:34:01 +02:00
|
|
|
bitmap_clear (updated_nodes);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2005-05-25 14:34:01 +02:00
|
|
|
if (dump_file)
|
2005-11-05 01:54:05 +01:00
|
|
|
{
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2011-02-28 14:32:28 +01:00
|
|
|
" Inlined into %s which now has time %i and size %i,"
|
2009-05-25 23:59:24 +02:00
|
|
|
"net change of %+i.\n",
|
2005-11-05 01:54:05 +01:00
|
|
|
cgraph_node_name (edge->caller),
|
cgraphbuild.c: Include ipa-inline.h.
* cgraphbuild.c: Include ipa-inline.h.
(reset_inline_failed): Use initialize_inline_failed.
* cgraph.c: Include ipa-inline.h.
(cgraph_create_node_1): Do not initialize estimated_growth.
(initialize_inline_failed): More to ipa-inline-analysis.c
(dump_cgraph_node): Do not dump inline flags.
* cgraph.h (cgraph_local_info): Remove inlineable, versionable
and disregard_inline_limits flags.
(cgrpah_global_info): Remove estimated_stack_size, stack_frame_offset,
time, size, estimated_growth.
* ipa-cp.c (ipcp_versionable_function_p, ipcp_generate_summary): Update.
* cgraphunit.c (cgraph_decide_is_function_needed): Use
DECL_DISREGARD_INLINE_LIMITS.
(cgraph_analyze_function): Do not initialize
node->local.disregard_inline_limits.
* lto-cgraph.c (lto_output_node, input_overwrite_node): Do not stream
inlinable, versionable and disregard_inline_limits.
* ipa-inline.c (cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_check_inline_limits, cgraph_default_inline_p, cgraph_edge_badness,
update_caller_keys, update_callee_keys, add_new_edges_to_heap): Update.
(cgraph_decide_inlining_of_small_function): Update; set CIF_FUNCTION_NOT_INLINABLE
for uninlinable functions.
(cgraph_decide_inlining, cgraph_edge_early_inlinable_p,
cgraph_decide_inlining_incrementally): Update.
* ipa-inline.h (inline_summary): Add inlinable, versionable, disregard_inline_limits,
estimated_stack_size, stack_frame_offset, time, size and estimated_growth
parameters.
(estimate_edge_growth): Update.
(initialize_inline_failed): Declare.
* ipa-split.c: Include ipa-inline.h
(execute_split_functions): Update.
* ipa.c (cgraph_postorder): Use DECL_DISREGARD_INLINE_LIMITS.
(cgraph_remove_unreachable_nodes): Do not clear inlinable flag.
(record_cdtor_fn): Use DECL_DISREGARD_INLINE_LIMITS.
* ipa-inline-analysis.c (inline_node_removal_hook): Update; set
estimated_growth to INT_MIN.
(inline_node_duplication_hook): Likewise.
(dump_inline_summary): Dump new fields.
(compute_inline_parameters): Update.
(estimate_edge_time, estimate_time_after_inlining,
estimate_size_after_inlining, estimate_growth, inline_read_summary,
inline_write_summary):
(initialize_inline_failed): Move here from cgraph.c.
* tree-sra.c: Include ipa-inline.h.
(ipa_sra_preliminary_function_checks): Update.
* lto/lto.c (lto_balanced_map): Update.
Update.
* Makefile.in: (cgraph.o, cgraphbuild.o): Add dependency on
ipa-inline.h
From-SVN: r172581
2011-04-16 11:13:08 +02:00
|
|
|
inline_summary (edge->caller)->time,
|
|
|
|
inline_summary (edge->caller)->size,
|
2009-05-25 23:59:24 +02:00
|
|
|
overall_size - old_size);
|
2005-11-05 01:54:05 +01:00
|
|
|
}
|
2009-05-25 23:59:24 +02:00
|
|
|
if (min_size > overall_size)
|
2007-01-24 23:45:00 +01:00
|
|
|
{
|
2009-05-25 23:59:24 +02:00
|
|
|
min_size = overall_size;
|
|
|
|
max_size = compute_max_insns (min_size);
|
2007-01-24 23:45:00 +01:00
|
|
|
|
|
|
|
if (dump_file)
|
2009-05-25 23:59:24 +02:00
|
|
|
fprintf (dump_file, "New minimal size reached: %i\n", min_size);
|
2007-01-24 23:45:00 +01:00
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
2008-07-23 21:45:45 +02:00
|
|
|
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
free_growth_caches ();
|
2008-07-23 21:45:45 +02:00
|
|
|
if (new_indirect_edges)
|
|
|
|
VEC_free (cgraph_edge_p, heap, new_indirect_edges);
|
backport: As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html...
Merge from cxx-conversion branch (http://gcc.gnu.org/wiki/cxx-conversion).
As described in http://gcc.gnu.org/ml/gcc/2012-08/msg00015.html, this patch
changes the default bootstrap process so that stage 1 always builds with a C++
compiler.
Other than the bootstrap change, the patch makes no functional changes to the
compiler. Everything should build as it does now in trunk. The main
changes in this patch are:
1- Configuration changes.
2- Re-write of VEC.
3- Re-write of gengtype to support C++ templates and
user-provided marking functions.
4- New hash table class.
5- Re-write double_int.
6- Implement tree macros as inline functions so they can be
called from gdb.
As discussed before, several of these changes do not fully change
the call sites to use the new APIs.
The bootstrap changes have already been tested on a wide range of
targets (http://gcc.gnu.org/wiki/CppBuildStatus). Additionally,
I have tested the merged trunk on: x86_64-unknown-linux-gnu,
mips64el-unknown-linux-gnu, powerpc64-unknown-linux-gnu,
i686-pc-linux-gnu, and ia64-unknown-linux-gnu.
ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch.
* Makefile.tpl (STAGE[+id+]_CXXFLAGS): Remove
POSTSTAGE1_CONFIGURE_FLAGS.
* Makefile.in: Regenerate.
* configure.ac (ENABLE_BUILD_WITH_CXX): Remove. Update all users.
Force C++ when bootstrapping.
* configure: Regenerate.
libcpp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* Makefile.in: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure.ac: Likewise.
* configure: Regenerate.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. New C++ hash table.
* include/symtab.h (typedef struct ht hash_table): Change the typedef
name to cpp_hash_table. Update all users of the typedef.
gcc/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* configure.ac (CXX_FOR_BUILD): Define and substitute.
(BUILD_CXXFLAGS): Define.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
Force all build to be with C++.
* Makefile.in (BUILD_CXXFLAGS): Use it.
Remove all handlers of ENABLE_BUILD_WITH_CXX.
* configure: Regenerate.
* config.in: Regenerate.
* doc/install.texi: Remove documentation for --enable-build-with-cxx
and --enable-build-poststage1-with-cxx.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-implement VEC in C++.
* vec.c (vec_heap_free): Convert into a template function.
(vec_gc_o_reserve_1): Make extern.
(vec_gc_p_reserve): Remove.
(vec_gc_p_reserve_exact): Remove.
(vec_gc_o_reserve): Remove.
(vec_gc_o_reserve_exact): Remove.
(vec_heap_o_reserve_1): Make extern.
(vec_heap_p_reserve): Remove.
(vec_heap_p_reserve_exact): Remove.
(vec_heap_o_reserve): Remove.
(vec_heap_o_reserve_exact): Remove.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
* vec.h (VEC_CHECK_INFO, VEC_CHECK_DECL, VEC_CHECK_PASS,
VEC_ASSERT, VEC_ASSERT_FAIL, vec_assert_fail): Move earlier
in the file.
(VEC): Define to vec_t<T>.
(vec_allocation_t): Define.
(struct vec_prefix): Move earlier in the file.
(vec_t<T>): New template.
(DEF_VEC_I, DEF_VECL_ALLOC_I, DEF_VEC_P, DEF_VEC_ALLOC_P,
DEF_VEC_O, DEF_VEC_ALLOC_P, DEF_VEC_O, DEF_VEC_ALLOC_O,
DEF_VEC_ALLOC_P_STACK, DEF_VEC_ALLOC_O_STACK,
DEF_VEC_ALLOC_I_STACK): Expand to 'struct vec_swallow_trailing_semi'.
(DEF_VEC_A): Provide template instantiations for
GC/PCH markers that do not traverse the vector.
(vec_stack_p_reserve): Remove.
(vec_stack_p_reserve_exact): Remove.
(vec_stack_p_reserve_exact_1): Remove.
(vec_stack_o_reserve): Remove.
(vec_stack_o_reserve_exact): Remove.
(vec_stack_free): Re-write as a template function.
(vec_reserve): New template function.
(vec_reserve_exact): New template function.
(vec_heap_free): New template function if GATHER_STATISTICS is
defined. Otherwise, macro that expands to free().
(VEC_length_1): New template function.
(VEC_length): Call it.
(VEC_empty_1): New template function.
(VEC_empty): Call it.
(VEC_address_1): New template function.
(VEC_address): Call it.
(VEC_last_1): New template function.
(VEC_last): Call it. Change return type to T&.
Change all users that used VEC_Os.
(VEC_index_1): New template function.
(VEC_index): Call it. Return a T& instead of a T*.
Update all callers that were using VEC_O before.
(VEC_iterate_1): New template function.
(VEC_iterate): Call it.
(VEC_embedded_size_1): New template function.
(VEC_embedded_size): Call it.
(VEC_embedded_init_1): New template function.
(VEC_embedded_init): Call it.
(VEC_alloc_1): New template function.
(VEC_alloc): Call it. If A is 'stack', call XALLOCAVAR to
do the allocation.
(VEC_free_1): New template function.
(VEC_free): Call it.
(VEC_copy_1): New template function.
(VEC_copy): Call it.
(VEC_space_1): New template function
(VEC_space): Call it.
(VEC_reserve_1): New template function.
(VEC_reserve): Call it.
(VEC_reserve_exact_1): New template function.
(VEC_reserve_exact): Call it.
(VEC_splice_1): New template function.
(VEC_splice): Call it.
(VEC_safe_splice_1): New template function.
(VEC_safe_splice): Call it.
(VEC_quick_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_quick_push): Call it.
(VEC_safe_push_1): New template function. Create two overloads, one
accepting T, the other accepting T *. Update all callers
where T and T * are ambiguous.
(VEC_safe_push): Call it.
(VEC_pop_1): New template function.
(VEC_pop): Call it.
(VEC_truncate_1): New template function.
(VEC_truncate): Call it.
(VEC_safe_grow_1): New template function.
(VEC_safe_grow): Call it.
(VEC_safe_grow_cleared_1): New template function.
(VEC_safe_grow_cleared): Call it.
(VEC_replace_1): New template function.
(VEC_replace): Call it. Always accept T instead of T*.
Update all callers that used VEC_Os.
(VEC_quick_insert_1): New template function.
(VEC_quick_insert): Call it.
(VEC_safe_insert_1): New template function.
(VEC_safe_insert): Call it.
(VEC_ordered_remove_1): New template function.
(VEC_ordered_remove): Call it.
(VEC_unordered_remove_1): New template function.
(VEC_unordered_remove): Call it.
(VEC_block_remove_1): New template function.
(VEC_block_remove): Call it.
(VEC_lower_bound_1): New template function.
(VEC_lower_bound): Call it.
(VEC_OP): Remove.
(DEF_VEC_FUNC_P): Remove.
(DEF_VEC_ALLOC_FUNC_P): Remove.
(DEF_VEC_NONALLOC_FUNCS_P): Remove.
(DEF_VEC_FUNC_O): Remove.
(DEF_VEC_ALLOC_FUNC_O): Remove.
(DEF_VEC_NONALLOC_FUNCS_O): Remove.
(DEF_VEC_ALLOC_FUNC_I): Remove.
(DEF_VEC_NONALLOC_FUNCS_I): Remove.
(DEF_VEC_ALLOC_FUNC_P_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_O_STACK): Remove.
(DEF_VEC_ALLOC_FUNC_I_STACK): Remove.
(vec_reserve_exact): New template function.
* gengtype-lex.l (DEF_VEC_ALLOC_[IOP]/{EOID}): Remove.
* gengtype-parse.c (token_names): Remove DEF_VEC_ALLOC_[IOP].
(typedef_name): Emit vec_t<C1> instead of VEC_C1_C2.
(def_vec_alloc): Remove. Update all callers.
* gengtype.c (filter_type_name): New.
(output_mangled_typename): Call it.
(write_func_for_structure): Likewise.
(write_types): Likewise.
(write_root): Likewise.
(write_typed_alloc_def): Likewise.
(note_def_vec): Emit vec_t<TYPE_NAME> instead of VEC_TYPE_NAME_base.
(note_def_vec_alloc): Remove.
* gengtype.h (note_def_vec_alloc): Remove.
(DEFVEC_ALLOC): Remove token code.
* df-scan.c (df_bb_verify): Remove call to df_free_collection_rec
inside the insn traversal loop.
* gimplify.c (gimplify_compound_lval): Rename STACK to EXPR_STACK.
* ipa-inline.c (inline_small_functions): Rename HEAP to EDGE_HEAP.
* reg-stack.c (stack): Rename to STACK_PTR. Update all users.
* tree-vrp.c (stack): Rename to EQUIV_STACK. Update all users.
* config/bfin/bfin.c (hwloop_optimize): Update some calls to
VEC_* for vectors of non-pointers.
* config/c6x/c6x.c (try_rename_operands): Likewise.
(reshuffle_units): Likewise.
* config/mips/mips.c (mips_multi_start): Likewise.
(mips_multi_add): Likewise.
(mips_multi_copy_insn): Likewise.
(mips_multi_set_operand): Likewise.
* hw-doloop.c (discover_loop): Likewise.
(discover_loops): Likewise.
(reorg_loops): Likewise.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. C++ support in gengtype.
* coretypes.h (gt_pointer_operator): Move from ...
* ggc.h: ... here.
* doc/gty.texi: Document support for C++ templates and
user-provided markers.
* gcc/gengtype-lex.l: Update copyright year.
Remove support for recognizing DEF_VEC_O, DEF_VEC_P and
DEFVEC_I.
* gengtype-parse.c: Update copyright year.
(token_names): Remove DEF_VEC_O, DEF_VEC_P and DEF_VEC_I.
(require_template_declaration): New.
(typedef_name): Call it.
(type): Replace IS_UNION with KIND. Replace all users.
(def_vec): Remove. Update all users.
* gengtype-state.c (type_lineloc): Handle TYPE_USER_STRUCT.
(write_state_user_struct_type): New.
(write_state_type): Call it.
(read_state_user_struct_type): New.
(read_state_type): Call it.
* gengtype.c: Update copyright year.
(dump_pair): Move declaration to the top.
(dump_type): Likewise.
(dump_type_list): Likewise.
(dbgprint_count_type_at): Handle TYPE_USER_STRUCT.
(create_user_defined_type): New.
(resolve_typedef): Call it.
(new_structure): Replace argument ISUNION with KIND.
Change users to refer to KIND directly.
Update all callers.
(find_structure): Likewise.
(set_gc_used_type): Handle TYPE_USER_STRUCT.
(create_file): Update HDR to include new copyright year.
(struct walk_type_data): Add field IN_PTR_FIELD.
(output_mangled_typename): Handle TYPE_USER_STRUCT.
(walk_type): Set D->IN_PTR_FIELD when walking a TYPE_POINTER.
Clear it afterwards.
Handle TYPE_USER_STRUCT.
(write_types_process_field): Handle TYPE_USER_STRUCT.
(get_type_specifier): Move earlier in the file.
(write_type_decl): New.
(write_marker_function_name): New.
(write_user_func_for_structure_ptr): New.
(write_user_func_for_structure_body): New.
(write_user_marking_functions): New.
(write_func_for_structure): Call write_marker_function_name
and write_type_decl.
Do not call walk_type for TYPE_USER_STRUCT. Emit a call to the user
function directly.
Call write_user_marking_functions on TYPE_USER_STRUCTs.
(write_types_local_user_process_field): New.
(write_pch_user_walking_for_structure_body): New.
(write_pch_user_walking_functions): New.
(write_types_local_process_field): Handle TYPE_USER_STRUCT.
(write_local_func_for_structure): Do not call walk_type for
TYPE_USER_STRUCT. Instead, emit the call to gt_pch_nx directly.
Call write_pch_user_walking_functions for TYPE_USER_STRUCTs.
(write_root): Handle TYPE_USER_STRUCT.
(vec_prefix_type): Remove. Update all users.
(note_def_vec): Remove. Update all users.
(dump_typekind): Handle TYPE_USER_STRUCT.
(dump_type): Initialize SEEN_TYPES, if needed.
Handle TYPE_USER_STRUCT.
(dump_everything): Do not initialize SEEN_TYPES.
* gengtype.h: Update copyright year.
(enum typekind): Add TYPE_USER_STRUCT.
(union_or_struct_p): Rename from UNION_OR_STRUCT_P.
Convert into function.
Add an overload taking const_type_p.
Update all callers.
(new_structure): Change second field to type enum typekind.
Update all users.
(find_structure): Likewise.
(note_def_vec): Remove.
(DEFVEC_OP): Remove.
(DEFVEC_I): Remove.
* ggc-page.c (gt_ggc_mx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
* ggc-zone.c (gt_ggc_mx): Add entry points for marking
'const char *&' and 'unsigned char *&'.
* stringpool.c (gt_pch_nx): Add entry points for marking
'const char *&', 'unsigned char *&' and 'unsigned char&'.
Add an entry point for the overload taking arguments 'unsigned char
*', 'gt_pointer_operator' and 'void *'.
* vec.h (struct vec_prefix): Remove GTY marker.
(struct vec_t): Remove GTY((length)) attribute from field 'vec'.
(gt_ggc_mx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T> *)): New template function.
(gt_pch_nx (vec_t<T *> *, gt_pointer_operator, void *)): New template
function.
(gt_pch_nx (vec_t<T> *, gt_pointer_operator, void *)): New template
function.
* basic-block.h (struct edge_def): Mark GTY((user)).
Remove all GTY markers from fields.
(gt_ggc_mx): Declare.
(gt_pch_nx): Declare.
* tree-cfg.c (gt_ggc_mx): New.
(gt_pch_nx): New.
* gengtype-lex.l (USER_GTY): Add pattern for "user".
* gengtype-parse.c (option): Handle USER_GTY.
(opts_have): New.
(type): Call it.
If the keyword 'user' is used, do not walk the fields
of the structure.
* gengtype.h (USER_GTY): Add.
* doc/gty.texi: Update.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Implement C++ hash table.
* hash-table.h: New. Implementation borrowed from libiberty/hashtab.c.
* hash-table.c: Likewise.
* tree-ssa-tail-merge.c: Include hash-table.h instead of hashtab.h.
(static htab_t same_succ_htab): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(same_succ_print_traverse): Make extern ssa_.... Change callers.
Remove void* casting.
(same_succ_hash): Likewise.
(same_succ_equal): Likewise.
(same_succ_delete): Likewise.
* tree-ssa-threadupdate.c: Include hash-table.h.
(struct local_info): Rename to ssa_local_info_t to avoid overloading
the type name local_info with the variable name local_info.
(static htab_t redirection_data): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(redirection_data_hash): Make extern ssa_.... Change callers.
Remove void* casting.
(redirection_data_eq): Likewise.
(fix_duplicate_block_edges): Likewise.
(create_duplicates): Likewise.
(fixup_template_block): Likewise.
(redirect_edges): Likewise.
(lookup_redirection_data): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
* tree-ssa-ccp.c: Include hash-table.h.
(typedef gimple_htab): New. Uses hash_table. Replace specific uses
of htab_t with gimple_htab. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* tree-ssa-coalesce.c: Include hash-table.h instead of hashtab.h.
(hash_ssa_name_by_var): Make extern. Remove void* casting.
(eq_ssa_name_by_var): Likewise.
(coalesce_ssa_name): Change type of local static htab_t ssa_name_hash
to hash_table. Change users to invoke member functions.
Move specification of helper functions from create call to declaration.
* coverage.c: Include hash-table.h instead of hashtab.h.
(static htab_t counts_hash): Change type to hash_table;
move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(htab_counts_entry_hash): Make extern. Rename with coverage_... instead
of htab_... Remove void* casting.
(htab_counts_entry_eq): Likewise.
(htab_counts_entry_del): Likewise.
* tree-ssa-pre.c: Include hash-table.h instead of hashtab.h.
(static htab_t expression_to_id): Change type to hash_table.
Move specification of helper functions from create call to declaration.
Change users to invoke member functions.
(static htab_t phi_translate_table): Likewise.
(pre_expr_eq): Make extern ssa_.... Change callers.
Remove void* casting.
(pre_expr_hash): Likewise.
(expr_pred_trans_hash): Likewise.
(expr_pred_trans_eq): Likewise.
(alloc_expression_id): Change types associated with the hash table
from void* to their actual type. Remove unnecessary casts.
(lookup_expression_id): Likewise.
(phi_trans_lookup): Likewise.
(phi_trans_add): Likewise.
* stringpool.c: Rename uses of libcpp typedef hash_table to
cpp_hash_table.
* Makefile.in: Add hash-table.o to OBJS-libcommon-target.
Add $(HASH_TABLE_H). Add new dependences on $(HASH_TABLE_H).
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge from cxx-conversion branch. Re-write double_int in C++.
* hash-table.h
(typedef double_int): Change to struct (POD).
(double_int::make): New overloads for int to double-int conversion.
(double_int::mask): New.
(double_int::max_value): New.
(double_int::min_value): New.
(double_int::operator ++): New.
(double_int::operator --): New.
(double_int::operator *=): New.
(double_int::operator +=): New.
(double_int::operator -=): New.
(double_int::to_signed): New.
(double_int::to_unsigned): New.
(double_int::fits_unsigned): New.
(double_int::fits_signed): New.
(double_int::fits): New.
(double_int::trailing_zeros): New.
(double_int::popcount): New.
(double_int::multiple_of): New.
(double_int::set_bit): New.
(double_int::mul_with_sign): New.
(double_int::operator * (binary)): New.
(double_int::operator + (binary)): New.
(double_int::operator - (binary)): New.
(double_int::operator - (unary)): New.
(double_int::operator ~ (unary)): New.
(double_int::operator & (binary)): New.
(double_int::operator | (binary)): New.
(double_int::operator ^ (binary)): New.
(double_int::and_not): New.
(double_int::lshift): New.
(double_int::rshift): New.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::lrotate): New.
(double_int::rrotate): New.
(double_int::div): New.
(double_int::sdiv): New.
(double_int::udiv): New.
(double_int::mod): New.
(double_int::smod): New.
(double_int::umod): New.
(double_int::divmod): New.
(double_int::sdivmod): New.
(double_int::udivmod): New.
(double_int::ext): New.
(double_int::zext): New.
(double_int::sext): New.
(double_int::is_zero): New.
(double_int::is_one): New.
(double_int::is_minus_one): New.
(double_int::is_negative): New.
(double_int::cmp): New.
(double_int::ucmp): New.
(double_int::scmp): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int::max): New.
(double_int::smax): New.
(double_int::umax): New.
(double_int::min): New.
(double_int::smin): New.
(double_int::umin): New.
(double_int::operator ==): New.
(double_int::operator !=): New.
(shwi_to_double_int): Change implementation to use member function.
(double_int_minus_one): Likewise.
(double_int_zero): Likewise.
(double_int_one): Likewise.
(double_int_two): Likewise.
(double_int_ten): Likewise.
(uhwi_to_double_int): Likewise.
(double_int_to_shwi): Likewise.
(double_int_to_uhwi): Likewise.
(double_int_fits_in_uhwi_p): Likewise.
(double_int_fits_in_shwi_p): Likewise.
(double_int_fits_in_hwi_p): Likewise.
(double_int_mul): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_setbit): Likewise.
(double_int_ctz): Likewise.
(double_int_not): Likewise.
(double_int_ior): Likewise.
(double_int_and): Likewise.
(double_int_and_not): Likewise.
(double_int_xor): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_scmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_ext): Likewise.
(double_int_sext): Likewise.
(double_int_zext): Likewise.
(double_int_mask): Likewise.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_zero_p): Likewise.
(double_int_one_p): Likewise.
(double_int_minus_one_p): Likewise.
(double_int_equal_p): Likewise.
(double_int_popcount): Likewise.
* hash-table.c
(double_int_mask): Reuse implementation for double_int::mask.
(double_int_max_value): Likewise.
(double_int_min_value): Likewise.
(double_int_ext): Likewise.
(double_int_zext): Likewise.
(double_int_sext): Likewise.
(double_int_mul_with_sign): Likewise.
(double_int_divmod): Likewise.
(double_int_sdivmod): Likewise.
(double_int_udivmod): Likewise.
(double_int_div): Likewise.
(double_int_sdiv): Likewise.
(double_int_udiv): Likewise.
(double_int_mod): Likewise.
(double_int_smod): Likewise.
(double_int_umod): Likewise.
(double_int_multiple_of): Likewise.
(double_int_lshift): Likewise.
(double_int_rshift): Likewise.
(double_int_lrotate): Likewise.
(double_int_rrotate): Likewise.
(double_int_cmp): Likewise.
(double_int_ucmp): Likewise.
(double_int_scmp): Likewise.
(double_int_max): Likewise.
(double_int_smax): Likewise.
(double_int_umax): Likewise.
(double_int_min): Likewise.
(double_int_smin): Likewise.
(double_int_umin): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int_min): Likewise.
(double_int::alshift): New.
(double_int::arshift): New.
(double_int::llshift): New.
(double_int::lrshift): New.
(double_int::ult): New.
(double_int::ugt): New.
(double_int::slt): New.
(double_int::sgt): New.
(double_int_setbit): Reuse implementation for double_int::set_bit,
which avoids a name conflict with a macro.
(double_int_double_int_ctz): Reuse implementation for
double_int::trailing_zeros.
(double_int_fits_in_shwi_p): Reuse implementation for
double_int::fits_signed.
(double_int_fits_in_hwi_p): Reuse implementation for double_int::fits.
(double_int_mul): Reuse implementation for binary
double_int::operator *.
(double_int_add): Likewise.
(double_int_sub): Likewise.
(double_int_neg): Reuse implementation for unary
double_int::operator -.
(double_int_max_value): Likewise.
* fixed-value.c: Change to use member functions introduced above.
2012-08-14 Lawrence Crowl <crowl@google.com>
Merge cxx-conversion branch. Support tree macro calling
from gdb.
* tree.h (tree_check): New.
(TREE_CHECK): Use inline function above instead of __extension__.
(tree_not_check): New.
(TREE_NOT_CHECK): Use inline function above instead of __extension__.
(tree_check2): New.
(TREE_CHECK2): Use inline function above instead of __extension__.
(tree_not_check2): New.
(TREE_NOT_CHECK2): Use inline function above instead of __extension__.
(tree_check3): New.
(TREE_CHECK3): Use inline function above instead of __extension__.
(tree_not_check3): New.
(TREE_NOT_CHECK3): Use inline function above instead of __extension__.
(tree_check4): New.
(TREE_CHECK4): Use inline function above instead of __extension__.
(tree_not_check4): New.
(TREE_NOT_CHECK4): Use inline function above instead of __extension__.
(tree_check5): New.
(TREE_CHECK5): Use inline function above instead of __extension__.
(tree_not_check5): New.
(TREE_NOT_CHECK5): Use inline function above instead of __extension__.
(contains_struct_check): New.
(CONTAINS_STRUCT_CHECK): Use inline function above instead of
__extension__.
(tree_class_check): New.
(TREE_CLASS_CHECK): Use inline function above instead of __extension__.
(tree_range_check): New.
(TREE_RANGE_CHECK): Use inline function above instead of __extension__.
(omp_clause_subcode_check): New.
(OMP_CLAUSE_SUBCODE_CHECK): Use inline function above instead of
__extension__.
(omp_clause_range_check): New.
(OMP_CLAUSE_RANGE_CHECK): Use inline function above instead of
__extension__.
(expr_check): New.
(EXPR_CHECK): Use inline function above instead of __extension__.
(non_type_check): New.
(NON_TYPE_CHECK): Use inline function above instead of __extension__.
(tree_vec_elt_check): New.
(TREE_VEC_ELT_CHECK): Use inline function above instead of
__extension__.
(omp_clause_elt_check): New.
(OMP_CLAUSE_ELT_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check): New.
(TREE_OPERAND_CHECK): Use inline function above instead of
__extension__.
(tree_operand_check_code): New.
(TREE_OPERAND_CHECK_CODE): Use inline function above instead of
__extension__.
(TREE_CHAIN): Simplify implementation.
(TREE_TYPE): Simplify implementation.
(tree_operand_length): Move for compilation dependences.
* gdbinit.in: (macro define __FILE__): New.
(macro define __LINE__): New.
(skip "tree.h"): New.
gcc/cp/ChangeLog
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Re-write VEC in C++.
* call.c (add_function_candidate): Remove const qualifier
from call to VEC_index.
2012-08-14 Diego Novillo <dnovillo@google.com>
Merge from cxx-conversion branch. Configury.
* go-c.h: Remove all handlers of ENABLE_BUILD_WITH_CXX.
* go-gcc.cc: Likewise.
* go-system.h: Likewise.
From-SVN: r190402
2012-08-15 03:56:07 +02:00
|
|
|
fibheap_delete (edge_heap);
|
2011-04-18 20:39:39 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file,
|
|
|
|
"Unit growth for small function inlining: %i->%i (%i%%)\n",
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
initial_size, overall_size,
|
|
|
|
initial_size ? overall_size * 100 / (initial_size) - 100: 0);
|
2005-05-25 14:34:01 +02:00
|
|
|
BITMAP_FREE (updated_nodes);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Flatten NODE. Performed both during early inlining and
|
|
|
|
at IPA inlining time. */
|
2010-04-12 15:37:32 +02:00
|
|
|
|
|
|
|
static void
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
flatten_function (struct cgraph_node *node, bool early)
|
2010-04-12 15:37:32 +02:00
|
|
|
{
|
|
|
|
struct cgraph_edge *e;
|
|
|
|
|
|
|
|
/* We shouldn't be called recursively when we are being processed. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
gcc_assert (node->symbol.aux == NULL);
|
2010-04-12 15:37:32 +02:00
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
node->symbol.aux = (void *) node;
|
2010-04-12 15:37:32 +02:00
|
|
|
|
|
|
|
for (e = node->callees; e; e = e->next_callee)
|
|
|
|
{
|
|
|
|
struct cgraph_node *orig_callee;
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
|
2010-04-12 15:37:32 +02:00
|
|
|
|
|
|
|
/* We've hit cycle? It is time to give up. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (callee->symbol.aux)
|
2010-04-12 15:37:32 +02:00
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file,
|
|
|
|
"Not inlining %s into %s to avoid cycle.\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (callee)),
|
|
|
|
xstrdup (cgraph_node_name (e->caller)));
|
2010-04-12 15:37:32 +02:00
|
|
|
e->inline_failed = CIF_RECURSIVE_INLINING;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* When the edge is already inlined, we just need to recurse into
|
|
|
|
it in order to fully flatten the leaves. */
|
|
|
|
if (!e->inline_failed)
|
|
|
|
{
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
flatten_function (callee, early);
|
2010-04-12 15:37:32 +02:00
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
/* Flatten attribute needs to be processed during late inlining. For
|
|
|
|
extra code quality we however do flattening during early optimization,
|
|
|
|
too. */
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
if (!early
|
2011-04-17 16:22:20 +02:00
|
|
|
? !can_inline_edge_p (e, true)
|
|
|
|
: !can_early_inline_edge_p (e))
|
|
|
|
continue;
|
|
|
|
|
2011-04-06 10:51:23 +02:00
|
|
|
if (cgraph_edge_recursive_p (e))
|
2010-04-12 15:37:32 +02:00
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, "Not inlining: recursive call.\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (gimple_in_ssa_p (DECL_STRUCT_FUNCTION (node->symbol.decl))
|
|
|
|
!= gimple_in_ssa_p (DECL_STRUCT_FUNCTION (callee->symbol.decl)))
|
2010-11-10 17:05:03 +01:00
|
|
|
{
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, "Not inlining: SSA form does not match.\n");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2010-04-12 15:37:32 +02:00
|
|
|
/* Inline the edge and flatten the inline clone. Avoid
|
|
|
|
recursing through the original node if the node was cloned. */
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, " Inlining %s into %s.\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (callee)),
|
|
|
|
xstrdup (cgraph_node_name (e->caller)));
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
orig_callee = callee;
|
2012-08-10 09:52:23 +02:00
|
|
|
inline_call (e, true, NULL, NULL, false);
|
2010-04-12 15:37:32 +02:00
|
|
|
if (e->callee != orig_callee)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
orig_callee->symbol.aux = (void *) node;
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
flatten_function (e->callee, early);
|
2010-04-12 15:37:32 +02:00
|
|
|
if (e->callee != orig_callee)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
orig_callee->symbol.aux = NULL;
|
2010-04-12 15:37:32 +02:00
|
|
|
}
|
|
|
|
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
node->symbol.aux = NULL;
|
2012-08-10 09:52:23 +02:00
|
|
|
if (!node->global.inlined_to)
|
|
|
|
inline_update_overall_summary (node);
|
2010-04-12 15:37:32 +02:00
|
|
|
}
|
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
/* Decide on the inlining. We do so in the topological order to avoid
|
|
|
|
expenses on updating data structures. */
|
|
|
|
|
2006-03-02 20:00:11 +01:00
|
|
|
static unsigned int
|
2011-04-17 16:22:20 +02:00
|
|
|
ipa_inline (void)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
|
|
|
struct cgraph_node *node;
|
|
|
|
int nnodes;
|
|
|
|
struct cgraph_node **order =
|
2006-01-31 20:56:55 +01:00
|
|
|
XCNEWVEC (struct cgraph_node *, cgraph_n_nodes);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
int i;
|
|
|
|
|
2011-09-22 13:57:43 +02:00
|
|
|
if (in_lto_p && optimize)
|
ipa-cp.c (ipcp_write_summary, [...]): New functions.
* ipa-cp.c (ipcp_write_summary, ipcp_read_summary): New functions.
(pass_ipa_cp): Register them.
(ipcp_init_stage): Analyze all functions for whopr/lto.
(ipcp_propagate_stage): Skip external calls.
(ipcp_iterate_stage): Call ipa_update_after_lto_read if needed.
* ipa-reference.c (write_node_summary_p): Fix thinko about availability.
* cgraphunit.c (ipa_passes): When in lto, ne er produce new summaries;
when in ltrans, skip executing of ipa passes since everything should've
been done.
* ipa-inline.c (cgraph_decide_inlining): Remove FIXMEs.
(inline_generate_summary): Likewise.
(inline_read_summary): New function.
(inline_write_summary): New function.
(pass_ipa_inline): Register new hooks.
* ipa-prop.c: Inlcude lto-streamer.h
(ipa_edge_args_vector): Update declaration.
(ipa_count_arguments, ipa_compute_jump_functions,
ipa_free_edge_args_substructures): Move ipa_edge_args_vector into ggc.
(ipa_write_jump_function, ipa_read_jump_function, ipa_write_node_info,
ipa_read_node_info): New static functions.
(ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Update.
(duplicate_array): Use xmalloc.
(duplicate_ggc_array): New.
(ipa_edge_duplication_hook): Use it.
(ipa_update_after_lto_read): New function.
* ipa-prop.h (ipa_prop_write_jump_functions,
ipa_prop_read_jump_functions): Declare.
(ipa_pass_through_data, ipa_ancestor_jf_data, ipa_member_ptr_cst,
jump_func_value, ipa_member_ptr_cst, ipa_edge_args): Add GTY markers.
(ipa_edge_args_vector): Move into GGC.
(ipa_check_create_edge_args): Update.
(ipa_update_after_lto_read): New.
* passes.c (ipa_write_summaries_1): When in wpa, do not write summaries.
(ipa_read_summaries): When in ltrans, so not read summaries.
* lto-streamer.c (lto_get_section_name): Add LTO_section_jump_functions.
* lto-streamer.h (LTO_section_jump_functions): New section.
(produce_asm): Declare.
* lto-cgraph.c (output_cgraph): Output edges in reverse order.
* lto-streamer-out.c (produce_asm): Export.
* lto-streamer-in.c: Include tree-pass.h
(input_function): Free dominance info when done.
(lto_read_body): Push ipa_inline in ltrans stage.
* gengtype.c (open_base_files): Add ipa-prop.h into includes.
* Makefile.in (GTFILES): Add ipa-prop.h
* lto.c (lto_fixup_jump_functions): New function.
(lto_fixup_decls): Use it.
From-SVN: r153449
2009-10-22 12:02:29 +02:00
|
|
|
ipa_update_after_lto_read ();
|
2008-08-24 19:11:13 +02:00
|
|
|
|
cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.h (struct inline_summary): Move to ipa-inline.h
(cgraph_local_info): Remove inline_summary.
* ipa-cp.c: Include ipa-inline.h.
(ipcp_cloning_candidate_p, ipcp_estimate_growth,
ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary
accesor.
* lto-cgraph.c (lto_output_node): Do not stream inline summary.
(input_overwrite_node): Do not set inline summary.
(input_node): Do not stream inline summary.
* ipa-inline.c (cgraph_decide_inlining): Dump inline summaries.
(cgraph_decide_inlining_incrementally): Do not try to estimate overall
growth; we do not have inline parameters computed for that anyway.
(cgraph_early_inlining): After inlining compute call_stmt_sizes.
* ipa-inline.h (struct inline_summary): Move here from ipa-inline.h
(inline_summary_t): New type and VECtor.
(debug_inline_summary, dump_inline_summaries): Declare.
(inline_summary): Use VOCtor.
(estimate_edge_growth): Kill hack computing call stmt size directly.
* lto-section-in.c (lto_section_name): Add inline section.
* ipa-inline-analysis.c: Include lto-streamer.h
(node_removal_hook_holder, node_duplication_hook_holder): New holders
(inline_node_removal_hook, inline_node_duplication_hook): New functions.
(inline_summary_vec): Define.
(inline_summary_alloc, dump_inline_summary, debug_inline_summary,
dump_inline_summaries): New functions.
(estimate_function_body_sizes): Properly compute size/time of outgoing calls.
(compute_inline_parameters): Alloc inline_summary; do not compute size/time
of incomming calls.
(estimate_edge_time): Avoid missing time summary hack.
(inline_read_summary): Read inline summary info.
(inline_write_summary): Write inline summary info.
(inline_free_summary): Free all hooks and inline summary vector.
* lto-streamer.h: Add LTO_section_inline_summary section.
* Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies.
* ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating.
* lto.c: Include ipa-inline.h
(add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor.
(ipa_node_duplication_hook): Fix declaration.
* Make-lang.in (lto.o): Update dependencies.
From-SVN: r172430
2011-04-14 15:26:44 +02:00
|
|
|
if (dump_file)
|
|
|
|
dump_inline_summaries (dump_file);
|
2005-05-25 14:34:01 +02:00
|
|
|
|
2011-04-30 01:42:15 +02:00
|
|
|
nnodes = ipa_reverse_postorder (order);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
cgraph.h (FOR_EACH_VARIABLE, [...]): New macros.
* cgraph.h (FOR_EACH_VARIABLE, FOR_EACH_VARIABLE, FOR_EACH_FUNCTION):
New macros.
* lto-symtab.c (lto_symtab_merge_cgraph_nodes): Use FOR_EACH
walkers to walk cgraph and varpool.
* cgraph.c (cgraph_node_for_asm): Likewise.
(dump_cgraph): Likewise.
* value-prof.c (init_node_map): Likewise.
* tree.c (free_lang_data_in_cgraph): Likewise.
* tree-emutls.c: (ipa_lower_emutls): Likewise.
* ipa-reference.c (generate_summary, propagate): Likewise.
* cgraphunit.c (verify_cgraph, cgraph_process_same_body_aliases,
cgraph_mark_functions_to_output, cgraph_output_in_order,
output_weakrefs, cgraph_materialize_all_clones,
cgraph_optimize): Likewise.
* lto-cgraph.c (merge_profile_summaries): Likewise.
(input_cgraph): Likewise.
* ipa-pure-const.c (generate_summary): Likewise.
(propagate): Likwise.
* ipa-utils.c (ipa_reduced_postorder): Likewise.
(ipa_free_postorder_info): Likewise.
(ipa_reverse_postorder): Likewise.
* ipa-inline.c (ipa_inline): Likewise.
* matrix-reorg.c (find_matrices_decl): Likewise.
(matrix_reorg): Likewise.
* tree-vectorizer.c (increase_alignment): Likewise.
* ipa.c (cgraph_remove_unreachable_nodes): Likewise.
(function_and_variable_visibility): Likewise.
(whole_program_function_and_variable_visibility): Likewise.
(ipa_cdtor_merge): Likewise.
* trans-mem.c (ipa_tm_execute): Likewise.
* ipa-inline-analysis.c (dump_inline_summaries): Likewise.
* ipa-prop.c (ipa_print_all_jump_functions): Likewise.
(ipa_print_all_params): Likewise.
(ipa_update_after_lto_read): Likewise.
* tree-profie.c (tree_profiling): Likewise.
* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
* passes.c (dump_passes): Likewise.
(do_per_function): Likewise.
(ipa_write_summaries): Likewise.
* varpool.c (dump_varpool): Likewise.
(varpool_node_for_asm): Likewise.
(varpool_assemble_pending_decls): Likewise.
* decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
walkers to walk cgraph and varpool.
* lto.c (read_cgraph_and_symbols): Use FOR_EACH
walkers to walk cgraph and varpool.
(materialize_cgraph): Likewise.
* lto-partition.c (lto_1_to_1_map): Likewise.
(lto_balanced_map): Likewise.
(lto_promote_cross_file_statics): Likewise.
From-SVN: r186492
2012-04-16 14:04:17 +02:00
|
|
|
FOR_EACH_FUNCTION (node)
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
node->symbol.aux = 0;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
|
|
|
if (dump_file)
|
2010-04-12 15:37:32 +02:00
|
|
|
fprintf (dump_file, "\nFlattening functions:\n");
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2010-04-12 15:37:32 +02:00
|
|
|
/* In the first pass handle functions to be flattened. Do this with
|
|
|
|
a priority so none of our later choices will make this impossible. */
|
|
|
|
for (i = nnodes - 1; i >= 0; i--)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2010-04-12 15:37:32 +02:00
|
|
|
node = order[i];
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Handle nodes to be flattened.
|
2010-04-12 15:37:32 +02:00
|
|
|
Ideally when processing callees we stop inlining at the
|
|
|
|
entry of cycles, possibly cloning that entry point and
|
|
|
|
try to flatten itself turning it into a self-recursive
|
|
|
|
function. */
|
|
|
|
if (lookup_attribute ("flatten",
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
DECL_ATTRIBUTES (node->symbol.decl)) != NULL)
|
ipa-prop.h (struct ipa_param_flags): Removed.
2008-09-11 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_param_flags): Removed.
(struct ipa_param_descriptor): New structure.
(struct ipa_node_params): ipcp_lattices, param_decls and
param_flags moved to ipa_param_description.
(ipa_get_ith_param): Renamed to ipa_get_param, changed to access
descriptors. Renamed all users.
(ipa_is_ith_param_modified): Renamed to ipa_is_param_modified,
changed to access descriptors. Renamed all users.
(ipa_is_ith_param_called): Renamed to ipa_is_param_called, changed
to access descriptors. Renamed all users.
* ipa-cp.c (ipcp_init_cloned_node): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
(ipcp_analyze_node): Likewise.
(ipcp_get_ith_lattice): Renamed to ipcp_get_lattice, changed to access
descriptors. Renamed all users.
(ipcp_initialize_node_lattices): Remove allocation.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
* ipa-prop.c (ipa_create_param_decls_array): Renamed to
ipa_populate_param_decls, made static, added parameter info,
renamed mt to node, removed allocation, changed to use
descriptors.
(ipa_count_formal_params): Made static, added parameter info,
renamed mt to node.
(ipa_initialize_node_params): New function.
(ipa_check_stmt_modifications): Changed to use descriptors.
(ipa_detect_param_modifications): Removed allocation, changed to
use descriptors.
(ipa_note_param_call): Changed to use descriptors.
(ipa_analyze_params_uses): Removed allocation.
(ipa_free_node_params_substructures): Changed to use descriptors.
(ipa_edge_duplication_hook): Use the unused attribute.
(ipa_node_duplication_hook): Use the unused attribute, changed to
use descriptors, changed to duplicate descriptors.
* ipa-inline.c (cgraph_mark_inline_edge): New parameter new_edges,
changed all callers. Call ipa_propagate_indirect_call_infos if doing
indirect inlining. Made static.
(cgraph_decide_inlining): Freeing ipa-prop structures after inlining
functions called only once.
(cgraph_decide_recursive_inlining): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining_of_small_functions): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining): Don't call
ipa_propagate_indirect_call_infos.
* ipa-prop.c: Check that vectors are allocated.
* ipa-inline.c (cgraph_mark_inline_edge): Returns boolean, true
iff a new cgraph edges have been created.
(cgraph_decide_inlining): New variable redo_always_inline.
Flattening and always_inlining loop until callgraph stabilizes.
* ipa-prop.c (update_call_notes_after_inlining): Returns boolean,
true iff new cgraph edges have been created.
(propagate_info_to_inlined_callees): Likewise.
(ipa_propagate_indirect_call_infos): Likewise.
From-SVN: r140293
2008-09-11 19:03:23 +02:00
|
|
|
{
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
if (dump_file)
|
2009-11-25 11:55:54 +01:00
|
|
|
fprintf (dump_file,
|
2010-04-12 15:37:32 +02:00
|
|
|
"Flattening %s\n", cgraph_node_name (node));
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
flatten_function (node, false);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
inline_small_functions ();
|
2012-05-10 22:17:36 +02:00
|
|
|
symtab_remove_unreachable_nodes (true, dump_file);
|
2011-04-17 16:22:20 +02:00
|
|
|
free (order);
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
/* We already perform some inlining of functions called once during
|
|
|
|
inlining small functions above. After unreachable nodes are removed,
|
|
|
|
we still might do a quick check that nothing new is found. */
|
2008-07-29 13:00:58 +02:00
|
|
|
if (flag_inline_functions_called_once)
|
2005-09-01 10:54:40 +02:00
|
|
|
{
|
2011-04-18 20:39:39 +02:00
|
|
|
int cold;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, "\nDeciding on functions called once:\n");
|
|
|
|
|
2011-04-18 20:39:39 +02:00
|
|
|
/* Inlining one function called once has good chance of preventing
|
|
|
|
inlining other function into the same callee. Ideally we should
|
|
|
|
work in priority order, but probably inlining hot functions first
|
|
|
|
is good cut without the extra pain of maintaining the queue.
|
|
|
|
|
|
|
|
??? this is not really fitting the bill perfectly: inlining function
|
|
|
|
into callee often leads to better optimization of callee due to
|
|
|
|
increased context for optimization.
|
|
|
|
For example if main() function calls a function that outputs help
|
|
|
|
and then function that does the main optmization, we should inline
|
|
|
|
the second with priority even if both calls are cold by themselves.
|
|
|
|
|
|
|
|
We probably want to implement new predicate replacing our use of
|
|
|
|
maybe_hot_edge interpreted as maybe_hot_edge || callee is known
|
|
|
|
to be hot. */
|
|
|
|
for (cold = 0; cold <= 1; cold ++)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
cgraph.h (FOR_EACH_VARIABLE, [...]): New macros.
* cgraph.h (FOR_EACH_VARIABLE, FOR_EACH_VARIABLE, FOR_EACH_FUNCTION):
New macros.
* lto-symtab.c (lto_symtab_merge_cgraph_nodes): Use FOR_EACH
walkers to walk cgraph and varpool.
* cgraph.c (cgraph_node_for_asm): Likewise.
(dump_cgraph): Likewise.
* value-prof.c (init_node_map): Likewise.
* tree.c (free_lang_data_in_cgraph): Likewise.
* tree-emutls.c: (ipa_lower_emutls): Likewise.
* ipa-reference.c (generate_summary, propagate): Likewise.
* cgraphunit.c (verify_cgraph, cgraph_process_same_body_aliases,
cgraph_mark_functions_to_output, cgraph_output_in_order,
output_weakrefs, cgraph_materialize_all_clones,
cgraph_optimize): Likewise.
* lto-cgraph.c (merge_profile_summaries): Likewise.
(input_cgraph): Likewise.
* ipa-pure-const.c (generate_summary): Likewise.
(propagate): Likwise.
* ipa-utils.c (ipa_reduced_postorder): Likewise.
(ipa_free_postorder_info): Likewise.
(ipa_reverse_postorder): Likewise.
* ipa-inline.c (ipa_inline): Likewise.
* matrix-reorg.c (find_matrices_decl): Likewise.
(matrix_reorg): Likewise.
* tree-vectorizer.c (increase_alignment): Likewise.
* ipa.c (cgraph_remove_unreachable_nodes): Likewise.
(function_and_variable_visibility): Likewise.
(whole_program_function_and_variable_visibility): Likewise.
(ipa_cdtor_merge): Likewise.
* trans-mem.c (ipa_tm_execute): Likewise.
* ipa-inline-analysis.c (dump_inline_summaries): Likewise.
* ipa-prop.c (ipa_print_all_jump_functions): Likewise.
(ipa_print_all_params): Likewise.
(ipa_update_after_lto_read): Likewise.
* tree-profie.c (tree_profiling): Likewise.
* tree-ssa-structalias.c (ipa_pta_execute): Likewise.
* passes.c (dump_passes): Likewise.
(do_per_function): Likewise.
(ipa_write_summaries): Likewise.
* varpool.c (dump_varpool): Likewise.
(varpool_node_for_asm): Likewise.
(varpool_assemble_pending_decls): Likewise.
* decl2.c (collect_candidates_for_java_method_alias): Use FOR_EACH
walkers to walk cgraph and varpool.
* lto.c (read_cgraph_and_symbols): Use FOR_EACH
walkers to walk cgraph and varpool.
(materialize_cgraph): Likewise.
* lto-partition.c (lto_1_to_1_map): Likewise.
(lto_balanced_map): Likewise.
(lto_promote_cross_file_statics): Likewise.
From-SVN: r186492
2012-04-16 14:04:17 +02:00
|
|
|
FOR_EACH_DEFINED_FUNCTION (node)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
2011-04-18 20:39:39 +02:00
|
|
|
if (want_inline_function_called_once_p (node)
|
|
|
|
&& (cold
|
|
|
|
|| cgraph_maybe_hot_edge_p (node->callers)))
|
2006-12-20 10:12:55 +01:00
|
|
|
{
|
2011-04-18 20:39:39 +02:00
|
|
|
struct cgraph_node *caller = node->callers->caller;
|
|
|
|
|
|
|
|
if (dump_file)
|
|
|
|
{
|
|
|
|
fprintf (dump_file,
|
|
|
|
"\nInlining %s size %i.\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
cgraph_node_name (node),
|
|
|
|
inline_summary (node)->size);
|
2011-04-18 20:39:39 +02:00
|
|
|
fprintf (dump_file,
|
|
|
|
" Called once from %s %i insns.\n",
|
|
|
|
cgraph_node_name (node->callers->caller),
|
|
|
|
inline_summary (node->callers->caller)->size);
|
|
|
|
}
|
|
|
|
|
2012-08-10 09:52:23 +02:00
|
|
|
inline_call (node->callers, true, NULL, NULL, true);
|
2011-04-18 20:39:39 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file,
|
|
|
|
" Inlined into %s which now has %i size\n",
|
|
|
|
cgraph_node_name (caller),
|
|
|
|
inline_summary (caller)->size);
|
2006-12-20 10:12:55 +01:00
|
|
|
}
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
ipa-prop.h (struct ipa_param_flags): Removed.
2008-09-11 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_param_flags): Removed.
(struct ipa_param_descriptor): New structure.
(struct ipa_node_params): ipcp_lattices, param_decls and
param_flags moved to ipa_param_description.
(ipa_get_ith_param): Renamed to ipa_get_param, changed to access
descriptors. Renamed all users.
(ipa_is_ith_param_modified): Renamed to ipa_is_param_modified,
changed to access descriptors. Renamed all users.
(ipa_is_ith_param_called): Renamed to ipa_is_param_called, changed
to access descriptors. Renamed all users.
* ipa-cp.c (ipcp_init_cloned_node): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
(ipcp_analyze_node): Likewise.
(ipcp_get_ith_lattice): Renamed to ipcp_get_lattice, changed to access
descriptors. Renamed all users.
(ipcp_initialize_node_lattices): Remove allocation.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
* ipa-prop.c (ipa_create_param_decls_array): Renamed to
ipa_populate_param_decls, made static, added parameter info,
renamed mt to node, removed allocation, changed to use
descriptors.
(ipa_count_formal_params): Made static, added parameter info,
renamed mt to node.
(ipa_initialize_node_params): New function.
(ipa_check_stmt_modifications): Changed to use descriptors.
(ipa_detect_param_modifications): Removed allocation, changed to
use descriptors.
(ipa_note_param_call): Changed to use descriptors.
(ipa_analyze_params_uses): Removed allocation.
(ipa_free_node_params_substructures): Changed to use descriptors.
(ipa_edge_duplication_hook): Use the unused attribute.
(ipa_node_duplication_hook): Use the unused attribute, changed to
use descriptors, changed to duplicate descriptors.
* ipa-inline.c (cgraph_mark_inline_edge): New parameter new_edges,
changed all callers. Call ipa_propagate_indirect_call_infos if doing
indirect inlining. Made static.
(cgraph_decide_inlining): Freeing ipa-prop structures after inlining
functions called only once.
(cgraph_decide_recursive_inlining): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining_of_small_functions): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining): Don't call
ipa_propagate_indirect_call_infos.
* ipa-prop.c: Check that vectors are allocated.
* ipa-inline.c (cgraph_mark_inline_edge): Returns boolean, true
iff a new cgraph edges have been created.
(cgraph_decide_inlining): New variable redo_always_inline.
Flattening and always_inlining loop until callgraph stabilizes.
* ipa-prop.c (update_call_notes_after_inlining): Returns boolean,
true iff new cgraph edges have been created.
(propagate_info_to_inlined_callees): Likewise.
(ipa_propagate_indirect_call_infos): Likewise.
From-SVN: r140293
2008-09-11 19:03:23 +02:00
|
|
|
/* Free ipa-prop structures if they are no longer needed. */
|
2011-09-22 13:57:43 +02:00
|
|
|
if (optimize)
|
2010-04-28 16:05:54 +02:00
|
|
|
ipa_free_all_structures_after_iinln ();
|
ipa-prop.h (struct ipa_param_flags): Removed.
2008-09-11 Martin Jambor <mjambor@suse.cz>
* ipa-prop.h (struct ipa_param_flags): Removed.
(struct ipa_param_descriptor): New structure.
(struct ipa_node_params): ipcp_lattices, param_decls and
param_flags moved to ipa_param_description.
(ipa_get_ith_param): Renamed to ipa_get_param, changed to access
descriptors. Renamed all users.
(ipa_is_ith_param_modified): Renamed to ipa_is_param_modified,
changed to access descriptors. Renamed all users.
(ipa_is_ith_param_called): Renamed to ipa_is_param_called, changed
to access descriptors. Renamed all users.
* ipa-cp.c (ipcp_init_cloned_node): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
(ipcp_analyze_node): Likewise.
(ipcp_get_ith_lattice): Renamed to ipcp_get_lattice, changed to access
descriptors. Renamed all users.
(ipcp_initialize_node_lattices): Remove allocation.
* ipa-inline.c (inline_indirect_intraprocedural_analysis): Call
ipa_initialize_node_params instead of ipa_count_formal_params and
ipa_create_param_decls_array.
* ipa-prop.c (ipa_create_param_decls_array): Renamed to
ipa_populate_param_decls, made static, added parameter info,
renamed mt to node, removed allocation, changed to use
descriptors.
(ipa_count_formal_params): Made static, added parameter info,
renamed mt to node.
(ipa_initialize_node_params): New function.
(ipa_check_stmt_modifications): Changed to use descriptors.
(ipa_detect_param_modifications): Removed allocation, changed to
use descriptors.
(ipa_note_param_call): Changed to use descriptors.
(ipa_analyze_params_uses): Removed allocation.
(ipa_free_node_params_substructures): Changed to use descriptors.
(ipa_edge_duplication_hook): Use the unused attribute.
(ipa_node_duplication_hook): Use the unused attribute, changed to
use descriptors, changed to duplicate descriptors.
* ipa-inline.c (cgraph_mark_inline_edge): New parameter new_edges,
changed all callers. Call ipa_propagate_indirect_call_infos if doing
indirect inlining. Made static.
(cgraph_decide_inlining): Freeing ipa-prop structures after inlining
functions called only once.
(cgraph_decide_recursive_inlining): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining_of_small_functions): Don't call
ipa_propagate_indirect_call_infos, pass new_edges to
cgraph_mark_inline_edge instead.
(cgraph_decide_inlining): Don't call
ipa_propagate_indirect_call_infos.
* ipa-prop.c: Check that vectors are allocated.
* ipa-inline.c (cgraph_mark_inline_edge): Returns boolean, true
iff a new cgraph edges have been created.
(cgraph_decide_inlining): New variable redo_always_inline.
Flattening and always_inlining loop until callgraph stabilizes.
* ipa-prop.c (update_call_notes_after_inlining): Returns boolean,
true iff new cgraph edges have been created.
(propagate_info_to_inlined_callees): Likewise.
(ipa_propagate_indirect_call_infos): Likewise.
From-SVN: r140293
2008-09-11 19:03:23 +02:00
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file,
|
2011-04-18 20:39:39 +02:00
|
|
|
"\nInlined %i calls, eliminated %i functions\n\n",
|
|
|
|
ncalls_inlined, nfunctions_inlined);
|
|
|
|
|
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraphbuild.c (build_cgraph_edges): Update call
of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraph.c (cgraph_create_edge_including_clones,
cgraph_create_edge_1, cgraph_allocate_init_indirect_info,
cgraph_update_edges_for_call_stmt_node): Do not take nest
argument; do not initialize call_stmt_size/time.
(dump_cgraph_node): Do not dump nest.
(cgraph_clone_edge): Do not take loop_nest argument;
do not propagate it; do not clone call_stmt_size/time.
(cgraph_clone_node): Likewise.
(cgraph_create_virtual_clone): Update.
* cgraph.h (struct cgraph_edge): Remove
call_stmt_size/call_stmt_time/loop_nest.
(cgraph_create_edge, cgraph_create_indirect_edge,
cgraph_create_edge_including_clones, cgraph_clone_node): Update
prototype.
* tree-emutls.c (gen_emutls_addr): Update.
* ipa-inline-transform.c (update_noncloned_frequencies): Do not handle
loop_nest; handle indirect calls, too.
(clone_inlined_nodes): Do not care about updating inline summaries.
* cgraphunit.c (cgraph_copy_node_for_versioning): Update.
* lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not
stream call_stmt_size/call_stmt_time/loop_nest.
* ipa-inline.c (edge_badness): Update.
(ipa_inline): dump summaries after inlining.
* ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t):
new.
(inline_edge_summary): New function.
* ipa-inline-analysis.c (edge_duplication_hook_holder): New holder.
(inline_edge_removal_hook): Handle edge summaries.
(inline_edge_duplication_hook): New hook.
(inline_summary_alloc): Alloc hooks.
(initialize_growth_caches): Do not register removal hooks.
(free_growth_caches); Do not free removal hook.
(dump_inline_edge_summary): New function.
(dump_inline_summary): Use it.
(estimate_function_body_sizes, estimate_edge_size_and_time): Update.
(inline_update_callee_summaries): New function.
(inline_merge_summary): Use it.
(do_estimate_edge_time, do_estimate_edge_growth): Update.
(read_inline_edge_summary): New function.
(inline_read_section): Use it.
(write_inline_edge_summary): New function.
(inline_write_summary): Use it.
(inline_free_summary): Free edge new holders.
* tree-inline.c (copy_bb): Update.
From-SVN: r172989
2011-04-27 00:05:50 +02:00
|
|
|
if (dump_file)
|
|
|
|
dump_inline_summaries (dump_file);
|
cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.h (struct inline_summary): Move to ipa-inline.h
(cgraph_local_info): Remove inline_summary.
* ipa-cp.c: Include ipa-inline.h.
(ipcp_cloning_candidate_p, ipcp_estimate_growth,
ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary
accesor.
* lto-cgraph.c (lto_output_node): Do not stream inline summary.
(input_overwrite_node): Do not set inline summary.
(input_node): Do not stream inline summary.
* ipa-inline.c (cgraph_decide_inlining): Dump inline summaries.
(cgraph_decide_inlining_incrementally): Do not try to estimate overall
growth; we do not have inline parameters computed for that anyway.
(cgraph_early_inlining): After inlining compute call_stmt_sizes.
* ipa-inline.h (struct inline_summary): Move here from ipa-inline.h
(inline_summary_t): New type and VECtor.
(debug_inline_summary, dump_inline_summaries): Declare.
(inline_summary): Use VOCtor.
(estimate_edge_growth): Kill hack computing call stmt size directly.
* lto-section-in.c (lto_section_name): Add inline section.
* ipa-inline-analysis.c: Include lto-streamer.h
(node_removal_hook_holder, node_duplication_hook_holder): New holders
(inline_node_removal_hook, inline_node_duplication_hook): New functions.
(inline_summary_vec): Define.
(inline_summary_alloc, dump_inline_summary, debug_inline_summary,
dump_inline_summaries): New functions.
(estimate_function_body_sizes): Properly compute size/time of outgoing calls.
(compute_inline_parameters): Alloc inline_summary; do not compute size/time
of incomming calls.
(estimate_edge_time): Avoid missing time summary hack.
(inline_read_summary): Read inline summary info.
(inline_write_summary): Write inline summary info.
(inline_free_summary): Free all hooks and inline summary vector.
* lto-streamer.h: Add LTO_section_inline_summary section.
* Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies.
* ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating.
* lto.c: Include ipa-inline.h
(add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor.
(ipa_node_duplication_hook): Fix declaration.
* Make-lang.in (lto.o): Update dependencies.
From-SVN: r172430
2011-04-14 15:26:44 +02:00
|
|
|
/* In WPA we use inline summaries for partitioning process. */
|
|
|
|
if (!flag_wpa)
|
|
|
|
inline_free_summary ();
|
2006-03-02 20:00:11 +01:00
|
|
|
return 0;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
2011-04-06 12:16:30 +02:00
|
|
|
/* Inline always-inline function calls in NODE. */
|
|
|
|
|
|
|
|
static bool
|
2011-04-17 16:22:20 +02:00
|
|
|
inline_always_inline_functions (struct cgraph_node *node)
|
2011-04-06 12:16:30 +02:00
|
|
|
{
|
|
|
|
struct cgraph_edge *e;
|
|
|
|
bool inlined = false;
|
|
|
|
|
|
|
|
for (e = node->callees; e; e = e->next_callee)
|
|
|
|
{
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (!DECL_DISREGARD_INLINE_LIMITS (callee->symbol.decl))
|
2011-04-06 12:16:30 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
if (cgraph_edge_recursive_p (e))
|
|
|
|
{
|
|
|
|
if (dump_file)
|
2011-04-17 16:22:20 +02:00
|
|
|
fprintf (dump_file, " Not inlining recursive call to %s.\n",
|
|
|
|
cgraph_node_name (e->callee));
|
2011-04-06 12:16:30 +02:00
|
|
|
e->inline_failed = CIF_RECURSIVE_INLINING;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!can_early_inline_edge_p (e))
|
2011-04-06 12:16:30 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
if (dump_file)
|
2011-04-17 16:22:20 +02:00
|
|
|
fprintf (dump_file, " Inlining %s into %s (always_inline).\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (e->callee)),
|
|
|
|
xstrdup (cgraph_node_name (e->caller)));
|
2012-08-10 09:52:23 +02:00
|
|
|
inline_call (e, true, NULL, NULL, false);
|
2011-04-06 12:16:30 +02:00
|
|
|
inlined = true;
|
|
|
|
}
|
2012-08-10 09:52:23 +02:00
|
|
|
if (inlined)
|
|
|
|
inline_update_overall_summary (node);
|
2011-04-06 12:16:30 +02:00
|
|
|
|
|
|
|
return inlined;
|
|
|
|
}
|
|
|
|
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
/* Decide on the inlining. We do so in the topological order to avoid
|
2010-04-12 15:37:32 +02:00
|
|
|
expenses on updating data structures. */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2007-01-21 19:35:27 +01:00
|
|
|
static bool
|
2011-04-17 16:22:20 +02:00
|
|
|
early_inline_small_functions (struct cgraph_node *node)
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
{
|
|
|
|
struct cgraph_edge *e;
|
2005-06-28 04:20:29 +02:00
|
|
|
bool inlined = false;
|
2007-01-21 19:35:27 +01:00
|
|
|
|
2011-04-06 12:16:30 +02:00
|
|
|
for (e = node->callees; e; e = e->next_callee)
|
2007-01-19 18:20:20 +01:00
|
|
|
{
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
struct cgraph_node *callee = cgraph_function_or_thunk_node (e->callee, NULL);
|
|
|
|
if (!inline_summary (callee)->inlinable
|
2011-04-17 16:22:20 +02:00
|
|
|
|| !e->inline_failed)
|
2011-04-06 12:16:30 +02:00
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Do not consider functions not declared inline. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (!DECL_DECLARED_INLINE_P (callee->symbol.decl)
|
2011-04-06 12:16:30 +02:00
|
|
|
&& !flag_inline_small_functions
|
|
|
|
&& !flag_inline_functions)
|
|
|
|
continue;
|
|
|
|
|
2007-01-19 18:20:20 +01:00
|
|
|
if (dump_file)
|
2011-04-06 12:16:30 +02:00
|
|
|
fprintf (dump_file, "Considering inline candidate %s.\n",
|
ipa-inline-transform.c (can_remove_node_now_p): Move out of...
* ipa-inline-transform.c (can_remove_node_now_p): Move out of...
(clone_inlined_nodes): ... here.
(inline_call): Use cgraph_function_or_thunk_node; redirect edge
to real destination prior inlining.
* ipa-inline.c (caller_growth_limits, can_inline_edge_p,
can_early_inline_edge_p, want_early_inline_function_p,
want_early_inline_function_p, want_inline_small_function_p,
want_inline_self_recursive_call_p, want_inline_function_called_once_p,
edge_badness, update_all_callee_keys, lookup_recursive_calls,
add_new_edges_to_heap, inline_small_functions, flatten_function,
inline_always_inline_functions, early_inline_small_functions): Use
cgraph_function_or_thunk_node.
* ipa-inline-analysis.c (evaluate_conditions_for_edge,
dump_inline_edge_summary, estimate_function_body_sizes): Likewise.
(do_estimate_edge_growth_1): Break out from ...
(do_estimate_growth) ... here; walk aliases.
(inline_generate_summary): Skip aliases.
From-SVN: r174901
2011-06-10 13:43:01 +02:00
|
|
|
cgraph_node_name (callee));
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!can_early_inline_edge_p (e))
|
|
|
|
continue;
|
|
|
|
|
2011-04-06 12:16:30 +02:00
|
|
|
if (cgraph_edge_recursive_p (e))
|
|
|
|
{
|
|
|
|
if (dump_file)
|
2011-04-17 16:22:20 +02:00
|
|
|
fprintf (dump_file, " Not inlining: recursive call.\n");
|
2007-02-04 14:01:13 +01:00
|
|
|
continue;
|
2011-04-06 12:16:30 +02:00
|
|
|
}
|
2010-04-12 15:37:32 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (!want_early_inline_function_p (e))
|
2011-04-06 12:16:30 +02:00
|
|
|
continue;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
|
2011-04-17 16:22:20 +02:00
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, " Inlining %s into %s.\n",
|
2012-04-30 23:34:35 +02:00
|
|
|
xstrdup (cgraph_node_name (callee)),
|
|
|
|
xstrdup (cgraph_node_name (e->caller)));
|
2012-08-10 09:52:23 +02:00
|
|
|
inline_call (e, true, NULL, NULL, true);
|
2011-04-17 16:22:20 +02:00
|
|
|
inlined = true;
|
2010-01-29 12:26:27 +01:00
|
|
|
}
|
2011-04-06 12:16:30 +02:00
|
|
|
|
2007-01-21 19:35:27 +01:00
|
|
|
return inlined;
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
}
|
|
|
|
|
2005-06-28 04:20:29 +02:00
|
|
|
/* Do inlining of small functions. Doing so early helps profiling and other
|
|
|
|
passes to be somewhat more effective and avoids some code duplication in
|
|
|
|
later real inlining pass for testcases with very many function calls. */
|
2006-03-02 20:00:11 +01:00
|
|
|
static unsigned int
|
2011-04-17 16:22:20 +02:00
|
|
|
early_inliner (void)
|
2005-06-28 04:20:29 +02:00
|
|
|
{
|
2011-04-11 16:57:06 +02:00
|
|
|
struct cgraph_node *node = cgraph_get_node (current_function_decl);
|
cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.c (dump_cgraph_node): Do not dump inline summaries.
* cgraph.h (struct inline_summary): Move to ipa-inline.h
(cgraph_local_info): Remove inline_summary.
* ipa-cp.c: Include ipa-inline.h.
(ipcp_cloning_candidate_p, ipcp_estimate_growth,
ipcp_estimate_cloning_cost, ipcp_insert_stage): Use inline_summary
accesor.
* lto-cgraph.c (lto_output_node): Do not stream inline summary.
(input_overwrite_node): Do not set inline summary.
(input_node): Do not stream inline summary.
* ipa-inline.c (cgraph_decide_inlining): Dump inline summaries.
(cgraph_decide_inlining_incrementally): Do not try to estimate overall
growth; we do not have inline parameters computed for that anyway.
(cgraph_early_inlining): After inlining compute call_stmt_sizes.
* ipa-inline.h (struct inline_summary): Move here from ipa-inline.h
(inline_summary_t): New type and VECtor.
(debug_inline_summary, dump_inline_summaries): Declare.
(inline_summary): Use VOCtor.
(estimate_edge_growth): Kill hack computing call stmt size directly.
* lto-section-in.c (lto_section_name): Add inline section.
* ipa-inline-analysis.c: Include lto-streamer.h
(node_removal_hook_holder, node_duplication_hook_holder): New holders
(inline_node_removal_hook, inline_node_duplication_hook): New functions.
(inline_summary_vec): Define.
(inline_summary_alloc, dump_inline_summary, debug_inline_summary,
dump_inline_summaries): New functions.
(estimate_function_body_sizes): Properly compute size/time of outgoing calls.
(compute_inline_parameters): Alloc inline_summary; do not compute size/time
of incomming calls.
(estimate_edge_time): Avoid missing time summary hack.
(inline_read_summary): Read inline summary info.
(inline_write_summary): Write inline summary info.
(inline_free_summary): Free all hooks and inline summary vector.
* lto-streamer.h: Add LTO_section_inline_summary section.
* Makefile.in (ipa-cp.o, ipa-inline-analysis.o): Update dependencies.
* ipa.c (cgraph_remove_unreachable_nodes): Fix dump file formating.
* lto.c: Include ipa-inline.h
(add_cgraph_node_to_partition, undo_partition): Use inline_summary accessor.
(ipa_node_duplication_hook): Fix declaration.
* Make-lang.in (lto.o): Update dependencies.
From-SVN: r172430
2011-04-14 15:26:44 +02:00
|
|
|
struct cgraph_edge *edge;
|
2007-01-21 19:35:27 +01:00
|
|
|
unsigned int todo = 0;
|
2009-05-15 19:11:00 +02:00
|
|
|
int iterations = 0;
|
2011-04-06 12:16:30 +02:00
|
|
|
bool inlined = false;
|
2005-06-28 04:20:29 +02:00
|
|
|
|
diagnostic-core.h: New.
* diagnostic-core.h: New. Contents moved from diagnostic.h and
toplev.h.
* diagnostic.c: Don't include toplev.h.
(progname): Define. Moved from toplev.c.
(seen_error): New function.
* diagnostic.h: Include diagnostic-core.h.
(diagnostic_t, emit_diagnostic): Don't declare here.
* toplev.c (progname): Move to toplev.c.
(emit_debug_global_declarations, compile_file, finalize,
do_compile, toplev_main): Use seen_error.
* toplev.h: Include diagnostic-core.h.
(trim_filename, GCC_DIAG_STYLE, ATTRIBUTE_GCC_DIAG,
internal_error, warning, warning_at, error, error_n, error_at,
fatal_error, pedwarn, permerror, sorry, inform, inform_n,
verbatim, fnotice, progname): Move to diagnostic-core.h.
* builtins.c: Include diagnostic-core.h instead of diagnostic.h.
(expand_builtin_expect): Use seen_error.
* c-decl.c: Include diagnostic-core.h instead of diagnostic.h.
(c_make_fname_decl, c_write_global_declarations): Use seen_error.
* c-format.c: Include diagnostic-core.h instead of diagnostic.h.
* c-gimplify.c: Include diagnostic-core.h instead of diagnostic.h.
* c-lang.c: Include diagnostic-core.h instead of diagnostic.h.
* c-lex.c (c_lex_with_flags, interpret_float): Don't increment
errorcount for errors.
* c-opts.c (c_common_finish): Use seen_error.
* cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
* cgraphunit.c (verify_cgraph_node, verify_cgraph,
cgraph_output_pending_asms, cgraph_optimize): Use seen_error.
* coverage.c: Include diagnostic-core.h instead of diagnostic.h.
(get_coverage_counts): Use seen_error.
* dwarf2out.c (dwarf2out_finish): Use seen_error.
* gimplify.c (gimplify_var_or_parm_decl, gimple_push_cleanup,
gimplify_body): Use seen_error.
* ipa-inline.c (cgraph_early_inlining): Use seen_error.
* ipa-pure-const.c (gate_pure_const): Use seen_error.
* ipa-reference.c (gate_reference): Use seen_error.
* jump.c: Include diagnostic-core.h instead of diagnostic.h.
* lambda-code.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-cgraph.c: Include diagnostic-core.h instead of diagnostic.h.
* lto-compress.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-section-in.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-streamer-out.c: Include diagnostic-core.h instead of
diagnostic.h.
* lto-streamer.c: Include diagnostic-core.h instead of
diagnostic.h.
(gate_lto_out): Use seen_error.
* matrix-reorg.c: Include diagnostic-core.h instead of
diagnostic.h.
* omega.c: Include diagnostic-core.h instead of diagnostic.h.
* omp-low.c: Include diagnostic-core.h instead of diagnostic.h.
(gate_expand_omp, lower_omp_1): Use seen_error.
* passes.c: Include diagnostic-core.h instead of diagnostic.h.
(rest_of_decl_compilation, rest_of_type_compilation,
gate_rest_of_compilation, ipa_write_summaries): Use seen_error.
* tree-cfg.c (label_to_block_fn): Use seen_error.
* tree-inline.c (optimize_inline_calls): Use seen_error.
* tree-mudflap.c (mudflap_finish_file): Use
seen_error.
* tree-optimize.c (gate_all_optimizations,
gate_all_early_local_passes, gate_all_early_optimizations): Use
seen_error.
* tree-ssa-structalias.c (gate_ipa_pta): Use seen_error.
* varpool.c: Include diagnostic-core.h instead of diagnostic.h.
(varpool_remove_unreferenced_decls,
varpool_assemble_pending_decls): Use seen_error.
* Makefile.in (DIAGNOSTIC_CORE_H): Define.
(TOPLEV_H, DIAGNOSTIC_H): Update.
(c-decl.o, c-lang.o, c-format.o, lto-compress.o, lto-cgraph.o,
lto-streamer-out.o, lto-section-in.o, lto-streamer.o,
c-gimplify.o, omp-low.o, omega.o, diagnostic.o, passes.o,
builtins.o, jump.o, cgraph.o, varpool.o, matrix-reorg.o,
coverage.o, lambda-code.o): Update dependencies.
cp:
* call.c: Include diagnostic-core.h instead of diagnostic.h.
* cp-lang.c: Don't include diagnostic.h
* name-lookup.c: Include diagnostic-core.h instead of
diagnostic.h.
(cp_emit_debug_info_for_using): Use seen_error.
* optimize.c: Include diagnostic-core.h instead of diagnostic.h.
* parser.c: Include diagnostic-core.h instead of diagnostic.h.
* pt.c (iterative_hash_template_arg): Use seen_error.
* repo.c: Include diagnostic-core.h instead of diagnostic.h.
* typeck2.c: Include diagnostic-core.h instead of diagnostic.h.
* Make-lang.in (cp/cp-lang.o, cp/typeck2.o, cp/call.o, cp/repo.o,
cp/optimize.o, cp/parser.o, cp/name-lookup.o): Update
dependencies.
lto:
* lto.c: Include diagnostic-core.h instead of diagnostic.h.
(read_cgraph_and_symbols, lto_main): Use seen_error.
* Make-lang.in (lto/lto.o): Update dependencies.
objc:
* objc-act.c: Include diagnostic-core.h instead of diagnostic.h.
* Make-lang.in (objc/objc-act.o): Update dependencies.
From-SVN: r159947
2010-05-27 22:16:07 +02:00
|
|
|
if (seen_error ())
|
2006-03-02 20:00:11 +01:00
|
|
|
return 0;
|
2010-04-12 15:37:32 +02:00
|
|
|
|
2011-04-30 13:01:26 +02:00
|
|
|
/* Do nothing if datastructures for ipa-inliner are already computed. This
|
|
|
|
happens when some pass decides to construct new function and
|
|
|
|
cgraph_add_new_function calls lowering passes and early optimization on
|
|
|
|
it. This may confuse ourself when early inliner decide to inline call to
|
|
|
|
function clone, because function clones don't have parameter list in
|
|
|
|
ipa-prop matching their signature. */
|
|
|
|
if (ipa_node_params_vector)
|
|
|
|
return 0;
|
|
|
|
|
2011-04-06 12:16:30 +02:00
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
verify_cgraph_node (node);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Even when not optimizing or not inlining inline always-inline
|
|
|
|
functions. */
|
2011-04-17 16:22:20 +02:00
|
|
|
inlined = inline_always_inline_functions (node);
|
2011-04-06 12:16:30 +02:00
|
|
|
|
2010-04-12 15:37:32 +02:00
|
|
|
if (!optimize
|
|
|
|
|| flag_no_inline
|
2011-04-17 16:22:20 +02:00
|
|
|
|| !flag_early_inlining
|
|
|
|
/* Never inline regular functions into always-inline functions
|
|
|
|
during incremental inlining. This sucks as functions calling
|
|
|
|
always inline functions will get less optimized, but at the
|
|
|
|
same time inlining of functions calling always inline
|
2011-04-18 20:39:39 +02:00
|
|
|
function into an always inline function might introduce
|
2011-04-17 16:22:20 +02:00
|
|
|
cycles of edges to be always inlined in the callgraph.
|
|
|
|
|
|
|
|
We might want to be smarter and just avoid this type of inlining. */
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
|| DECL_DISREGARD_INLINE_LIMITS (node->symbol.decl))
|
2011-04-06 12:16:30 +02:00
|
|
|
;
|
|
|
|
else if (lookup_attribute ("flatten",
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
DECL_ATTRIBUTES (node->symbol.decl)) != NULL)
|
2007-01-21 19:35:27 +01:00
|
|
|
{
|
2011-04-06 12:16:30 +02:00
|
|
|
/* When the function is marked to be flattened, recursively inline
|
|
|
|
all calls in it. */
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file,
|
|
|
|
"Flattening %s\n", cgraph_node_name (node));
|
gengtype.c (open_base_files): Add ipa-inline.h include.
* gengtype.c (open_base_files): Add ipa-inline.h include.
* ipa-cp.c (ipcp_get_lattice, ipcp_lattice_from_jfunc): Move to ipa-prop.c
update all uses.
* ipa-prop.c: (ipa_get_lattice, ipa_lattice_from_jfunc): ... here.
* ipa-inline-transform.c (inline_call): Use inline_merge_summary to merge
summary of inlined function into former caller.
* ipa-inline.c (max_benefit): Remove.
(edge_badness): Compensate for removal of benefits.
(update_caller_keys): Use reset_node_growth_cache/reset_edge_growth_cache.
(update_callee_keys): Likewise.
(update_all_callee_keys): Likewise.
(inline_small_functions): Do not collect max_benefit; do not
reset stimated_growth; call free_growth_caches and initialize_growth_caches.
* ipa-inline.h (struct condition, type clause_t, struct predicate, struct
size_time_entry): New structures.
(INLINE_SIZE_SCALE, INLINE_TIME_SCALE, MAX_CLAUSES): New constants.
(inline_summary): Remove size_inlining_benefit, time_inlining_benefit and
estimated_growth.
(edge_growth_cache_entry): New structure.
(node_growth_cache, edge_growth_cache): New global vars.
(estimate_growth): Turn into inline.
(inline_merge_summary, do_estimate_edge_growth, do_estimate_edge_time,
initialize_growth_caches, free_growth_caches): Declare.
(estimate_edge_growth): Rewrite.
(estimate_edge_time): Implement as inline cache lookup.
(reset_node_growth_cache, reset_edge_growth_cache): New inline functions.
(MAX_TIME): Reduce to allow multiplicatoin by INLINE_SIZE_SCALE.
(NUM_CONDITIONS): New constant.
(predicate_conditions): New enum.
(IS_NOT_CONSTANT): New constant.
(edge_removal_hook_holder): New var.
(node_growth_cache, edge_growth_cache): New global vars.
(true_predicate, single_cond_predicate, false_predicate, not_inlined_predicate,
add_condition, add_clause, and_predicates, or_predicates, predicates_equal_p,
evaulate_predicate, dump_condition, dump_clause, dump_predicate, account_size_time,
evaulate_conditions_for_edge): New functions.
(inline_summary_alloc): Move to heap.
(inline_node_removal_hook): Clear condition and entry vectors.
(inline_edge_removal_hook): New function.
(initialize_growth_caches, free_growth_caches): New function.
(dump_inline_summary): Update.
(edge_execution_predicate): New function.
(will_be_nonconstant_predicate): New function.
(estimate_function_body_sizes): Compute BB and constantness predicates.
(compute_inline_parameters): Do not clear estimated_growth.
(estimate_edge_size_and_time): New function.
(estimate_calls_size_and_time): New function.
(estimate_callee_size_and_time): New function.
(remap_predicate): New function.
(inline_merge_summary): New function.
(do_estimate_edge_time): New function based on...
(estimate_edge_time): ... this one.
(do_estimate_edge_growth): New function.
(do_estimate_growth): New function based on....
(estimate_growth): ... this one.
(inline_analyze_function): Analyze after deciding on jump functions.
(inline_read_section): New function.
(inline_read_summary): Use it.
(inline_write_summary): Write all the new data.
* ipa-prop.c (ipa_get_param_decl_index): Export.
(ipa_lattice_from_jfunc): Move here from ipa-cp.c
* ipa-prop.h (ipa_get_param_decl_index, ipa_lattice_from_jfunc): Declare.
(ipa_get_lattice): Move hre from ipa-cp.c
* Makefile.in (GTFILES): Add ipa-inline.h and ipa-inline-analysis.c
* params.def (PARAM_EARLY_INLINING_INSNS): Set to 11.
* cgraph.h (cgraph_clone_inlined_nodes, compute_inline_parameters,
cgraph_edge_inlinable_p): Remove.
* cgraphunit.c: Include ipainline.h
(cgraph_process_new_functions): Update call of compute_inline_parameters.
* gcc.dg/tree-ssa/pr38699.c: Fix testcase.
From-SVN: r172873
2011-04-22 22:04:42 +02:00
|
|
|
flatten_function (node, true);
|
2011-04-06 12:16:30 +02:00
|
|
|
inlined = true;
|
2007-01-21 19:35:27 +01:00
|
|
|
}
|
2010-04-12 15:37:32 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
/* We iterate incremental inlining to get trivial cases of indirect
|
|
|
|
inlining. */
|
|
|
|
while (iterations < PARAM_VALUE (PARAM_EARLY_INLINER_MAX_ITERATIONS)
|
2011-04-17 16:22:20 +02:00
|
|
|
&& early_inline_small_functions (node))
|
2010-04-12 15:37:32 +02:00
|
|
|
{
|
|
|
|
timevar_push (TV_INTEGRATION);
|
|
|
|
todo |= optimize_inline_calls (current_function_decl);
|
2011-04-17 16:22:20 +02:00
|
|
|
|
|
|
|
/* Technically we ought to recompute inline parameters so the new
|
|
|
|
iteration of early inliner works as expected. We however have
|
|
|
|
values approximately right and thus we only need to update edge
|
|
|
|
info that might be cleared out for newly discovered edges. */
|
|
|
|
for (edge = node->callees; edge; edge = edge->next_callee)
|
|
|
|
{
|
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraphbuild.c (build_cgraph_edges): Update call
of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraph.c (cgraph_create_edge_including_clones,
cgraph_create_edge_1, cgraph_allocate_init_indirect_info,
cgraph_update_edges_for_call_stmt_node): Do not take nest
argument; do not initialize call_stmt_size/time.
(dump_cgraph_node): Do not dump nest.
(cgraph_clone_edge): Do not take loop_nest argument;
do not propagate it; do not clone call_stmt_size/time.
(cgraph_clone_node): Likewise.
(cgraph_create_virtual_clone): Update.
* cgraph.h (struct cgraph_edge): Remove
call_stmt_size/call_stmt_time/loop_nest.
(cgraph_create_edge, cgraph_create_indirect_edge,
cgraph_create_edge_including_clones, cgraph_clone_node): Update
prototype.
* tree-emutls.c (gen_emutls_addr): Update.
* ipa-inline-transform.c (update_noncloned_frequencies): Do not handle
loop_nest; handle indirect calls, too.
(clone_inlined_nodes): Do not care about updating inline summaries.
* cgraphunit.c (cgraph_copy_node_for_versioning): Update.
* lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not
stream call_stmt_size/call_stmt_time/loop_nest.
* ipa-inline.c (edge_badness): Update.
(ipa_inline): dump summaries after inlining.
* ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t):
new.
(inline_edge_summary): New function.
* ipa-inline-analysis.c (edge_duplication_hook_holder): New holder.
(inline_edge_removal_hook): Handle edge summaries.
(inline_edge_duplication_hook): New hook.
(inline_summary_alloc): Alloc hooks.
(initialize_growth_caches): Do not register removal hooks.
(free_growth_caches); Do not free removal hook.
(dump_inline_edge_summary): New function.
(dump_inline_summary): Use it.
(estimate_function_body_sizes, estimate_edge_size_and_time): Update.
(inline_update_callee_summaries): New function.
(inline_merge_summary): Use it.
(do_estimate_edge_time, do_estimate_edge_growth): Update.
(read_inline_edge_summary): New function.
(inline_read_section): Use it.
(write_inline_edge_summary): New function.
(inline_write_summary): Use it.
(inline_free_summary): Free edge new holders.
* tree-inline.c (copy_bb): Update.
From-SVN: r172989
2011-04-27 00:05:50 +02:00
|
|
|
struct inline_edge_summary *es = inline_edge_summary (edge);
|
|
|
|
es->call_stmt_size
|
2011-04-17 16:22:20 +02:00
|
|
|
= estimate_num_insns (edge->call_stmt, &eni_size_weights);
|
cgraphbuild.c (build_cgraph_edges): Update call of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraphbuild.c (build_cgraph_edges): Update call
of cgraph_create_edge and cgraph_create_indirect_edge.
* cgraph.c (cgraph_create_edge_including_clones,
cgraph_create_edge_1, cgraph_allocate_init_indirect_info,
cgraph_update_edges_for_call_stmt_node): Do not take nest
argument; do not initialize call_stmt_size/time.
(dump_cgraph_node): Do not dump nest.
(cgraph_clone_edge): Do not take loop_nest argument;
do not propagate it; do not clone call_stmt_size/time.
(cgraph_clone_node): Likewise.
(cgraph_create_virtual_clone): Update.
* cgraph.h (struct cgraph_edge): Remove
call_stmt_size/call_stmt_time/loop_nest.
(cgraph_create_edge, cgraph_create_indirect_edge,
cgraph_create_edge_including_clones, cgraph_clone_node): Update
prototype.
* tree-emutls.c (gen_emutls_addr): Update.
* ipa-inline-transform.c (update_noncloned_frequencies): Do not handle
loop_nest; handle indirect calls, too.
(clone_inlined_nodes): Do not care about updating inline summaries.
* cgraphunit.c (cgraph_copy_node_for_versioning): Update.
* lto-cgraph.c (lto_output_edge, input_node, input_edge): Do not
stream call_stmt_size/call_stmt_time/loop_nest.
* ipa-inline.c (edge_badness): Update.
(ipa_inline): dump summaries after inlining.
* ipa-inline.h (struct inline_edge_summary, inline_edge_summary_t):
new.
(inline_edge_summary): New function.
* ipa-inline-analysis.c (edge_duplication_hook_holder): New holder.
(inline_edge_removal_hook): Handle edge summaries.
(inline_edge_duplication_hook): New hook.
(inline_summary_alloc): Alloc hooks.
(initialize_growth_caches): Do not register removal hooks.
(free_growth_caches); Do not free removal hook.
(dump_inline_edge_summary): New function.
(dump_inline_summary): Use it.
(estimate_function_body_sizes, estimate_edge_size_and_time): Update.
(inline_update_callee_summaries): New function.
(inline_merge_summary): Use it.
(do_estimate_edge_time, do_estimate_edge_growth): Update.
(read_inline_edge_summary): New function.
(inline_read_section): Use it.
(write_inline_edge_summary): New function.
(inline_write_summary): Use it.
(inline_free_summary): Free edge new holders.
* tree-inline.c (copy_bb): Update.
From-SVN: r172989
2011-04-27 00:05:50 +02:00
|
|
|
es->call_stmt_time
|
2011-04-17 16:22:20 +02:00
|
|
|
= estimate_num_insns (edge->call_stmt, &eni_time_weights);
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
if (edge->callee->symbol.decl
|
2011-12-05 09:51:53 +01:00
|
|
|
&& !gimple_check_call_matching_types (edge->call_stmt,
|
cgraph.h: Update copyrights;
* cgraph.h: Update copyrights;
(symtab_node): Turn to union typedef.
(symtab_node_base): New structure.
(symtab_type): Add SYMTAB_SYMBOL tag.
* cgraph.c: Update references to fields
(cgraph_hash, assembler_name_hash): Turn into symtab_node.
(cgraph_local_info): Remove lto_file_data
and externally_visible.
(cgraph_node): Remove decl; same_comdat_group list;
aux; ref_list; order; address_taken; reachable_from_other_parittion,
in_other_partition; resolution.
(varpool_node): Remove decl; same_comdat_group;
ref_list; lto_file_data; aux; order; resolution; externally_visible;
used_from_other_partition; in_other_partition.
(symtab_node_def); New union.
(cgraph, varpool): Update.
(varpool_first_static_initializer, varpool_next_static_initializer,
cgraph_only_called_directly_or_aliased_p,
varpool_can_remove_if_no_refs, varpool_can_remove_if_no_refs,
varpool_all_refs_explicit_p, cgraph_alias_aliased_node,
varpool_alias_aliased_node, cgraph_edge_recursive_p): Update
field references.
* cgraph.c: Likewise.
* cgraphbuild.c: Likewise.
* lto-symtab.c: Likewise.
* c-gimplify.c: Likewise.
* value-prof.c: Likewise.
* tree.c: Likewise.
* ipa-cp.c: Likewise.
* tree-emutls.c: Likewise.
* ipa-inline-transform.c: Likwise.
* ipa-reference.c: Likewise.
* cgraphunit.c: Likewise.
* ipa-ref.c: Likewise.
* lto-cgraph.c: Likewise.
* ipa-ref-inline.h: Likewise.
* ipa-pure-const.c: Likewise.
* lto-streamer-out.c: Likewise.
* ipa-utils.c: Likewise.
* ipa-inline.c: Likewise.
* matrix-reorg.c: Likewise.
* tree-eh.c: Likewise.
* tree-vectorizer.c: Likewise.
* ipa-split.c: Likewise.
* ipa.c: Likewise.
* trans-mem.c: Likewise.
* ipa-inline-analysis.c: Likewise.
* gimplify.c: Likewise.
* cfgexpand.c: Likewise.
* tree-sra.c: Likewise.
* ipa-prop.c: Likewise.
* varasm.c: Likewise.
* tree-nested.c: Likewise.
* tree-inline.c: Likewise.
* tree-profile.c: Likewise.
* tree-ssa-structalias.c: Likewise.
* passes.c: Likewise.
* varpool.c: Likewise.
* tree.c: Update field referenced for new cgraph/varpool layout.
* decl2.c: Likewise.
* gcc-interface/trans.c (finalize_nrv): Update field referenced for new
cgraph/varpool layout.
* lto.c: Update field referenced for new cgraph/varpool layout.
* lto-partition.c: Likewise.
From-SVN: r186450
2012-04-14 12:24:59 +02:00
|
|
|
edge->callee->symbol.decl))
|
2011-12-05 09:51:53 +01:00
|
|
|
edge->call_stmt_cannot_inline_p = true;
|
2011-04-17 16:22:20 +02:00
|
|
|
}
|
2010-04-12 15:37:32 +02:00
|
|
|
timevar_pop (TV_INTEGRATION);
|
2011-04-06 12:16:30 +02:00
|
|
|
iterations++;
|
|
|
|
inlined = false;
|
2010-04-12 15:37:32 +02:00
|
|
|
}
|
|
|
|
if (dump_file)
|
|
|
|
fprintf (dump_file, "Iterations: %i\n", iterations);
|
|
|
|
}
|
|
|
|
|
2011-04-06 12:16:30 +02:00
|
|
|
if (inlined)
|
|
|
|
{
|
|
|
|
timevar_push (TV_INTEGRATION);
|
|
|
|
todo |= optimize_inline_calls (current_function_decl);
|
|
|
|
timevar_pop (TV_INTEGRATION);
|
|
|
|
}
|
|
|
|
|
2008-12-10 00:01:15 +01:00
|
|
|
cfun->always_inline_functions_inlined = true;
|
2005-06-28 04:20:29 +02:00
|
|
|
|
2010-04-12 15:37:32 +02:00
|
|
|
return todo;
|
2005-06-28 04:20:29 +02:00
|
|
|
}
|
|
|
|
|
2009-11-25 11:55:54 +01:00
|
|
|
struct gimple_opt_pass pass_early_inline =
|
2005-06-28 04:20:29 +02:00
|
|
|
{
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
{
|
|
|
|
GIMPLE_PASS,
|
2005-06-28 04:20:29 +02:00
|
|
|
"einline", /* name */
|
2010-04-12 15:37:32 +02:00
|
|
|
NULL, /* gate */
|
2011-04-17 16:22:20 +02:00
|
|
|
early_inliner, /* execute */
|
2005-06-28 04:20:29 +02:00
|
|
|
NULL, /* sub */
|
|
|
|
NULL, /* next */
|
|
|
|
0, /* static_pass_number */
|
timevar.def (TV_VARPOOL, [...]): Remove.
* timevar.def (TV_VARPOOL, TV_WHOPR_WPA_LTRANS_EXEC, TV_LIFE,
TV_LIFE_UPDATE, TV_DF_UREC, TV_INLINE_HEURISTICS,
TV_TREE_LINEAR_TRANSFORM, TV_TREE_LOOP_INIT, TV_TREE_LOOP_FINI,
TV_VPT, TV_LOCAL_ALLOC, TV_GLOBAL_ALLOC, TV_SEQABSTR): Remove.
(TV_IPA_INLINING, TV_FLATTEN_INLINING, TV_EARLY_INLINING,
TV_INLINE_PARAMETERS, TV_LOOP_INIT, TV_LOOP_FINI): New.
* timevar.c (timevar_print): Make printing width of timevar names
more flexible, but enforce maximum length.
* ipa-inline.c (pass_early_inline): Use TV_EARLY_INLINING.
(pass_ipa_inline): Use TV_IPA_INLINING.
* ipa-inline-analysis.c (pass_inline_parameters): Use
TV_INLINE_HEURISTICS.
* tree-ssa-loop.c (pass_tree_loop_init): No timevar for wrapper pass.
(pass_tree_loop_done): Likewise.
* final.c (pass_shorten_branches): Use TV_SHORTEN_BRANCH.
* loop-init.c (loop_optimizer_init): Push/pop TV_LOOP_INIT.
(loop_optimizer_finalize): Push/pop TV_LOOP_FINI.
From-SVN: r190409
2012-08-15 10:47:13 +02:00
|
|
|
TV_EARLY_INLINING, /* tv_id */
|
2011-04-06 12:16:30 +02:00
|
|
|
PROP_ssa, /* properties_required */
|
2009-04-03 22:15:40 +02:00
|
|
|
0, /* properties_provided */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
0, /* properties_destroyed */
|
|
|
|
0, /* todo_flags_start */
|
2011-06-14 21:39:36 +02:00
|
|
|
0 /* todo_flags_finish */
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
}
|
2007-01-16 22:30:54 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-04-12 15:37:32 +02:00
|
|
|
/* When to run IPA inlining. Inlining of always-inline functions
|
2011-06-23 18:45:08 +02:00
|
|
|
happens during early inlining.
|
|
|
|
|
|
|
|
Enable inlining unconditoinally at -flto. We need size estimates to
|
|
|
|
drive partitioning. */
|
2010-04-12 15:37:32 +02:00
|
|
|
|
|
|
|
static bool
|
2011-04-17 16:22:20 +02:00
|
|
|
gate_ipa_inline (void)
|
2010-04-12 15:37:32 +02:00
|
|
|
{
|
2011-06-23 18:45:08 +02:00
|
|
|
return optimize || flag_lto || flag_wpa;
|
2010-04-12 15:37:32 +02:00
|
|
|
}
|
|
|
|
|
2009-05-16 08:54:11 +02:00
|
|
|
struct ipa_opt_pass_d pass_ipa_inline =
|
2007-01-16 22:30:54 +01:00
|
|
|
{
|
re PR other/35094 (RTL dump file letters hosed and partly undocumented)
* gcc.dg/20050811-2.c: Update dumping flags.
* gcc.dg/sms-2.c: Update dumping flags.
* gcc.dg/var-expand1.c: Update dumping flags.
* gcc.dg/var-expand3.c: Update dumping flags.
* gcc.dg/pr30957-1.c: Update dumping flags.
* gcc.dg/20050811-1.c: Update dumping flags.
* gcc.dg/cpp/cmdlne-dI-M.C: Do not xfail.
* gcc.dg/cpp/cmdlne-dM-M.C: Do not xfail.
PR other/35094
* toplev.c (decode_d_option): Handle all CPP flags.
* tree-vrp.c: Update tree_pass descriptors.
* regrename.c: Update tree_pass descriptors.
* fwprop.c: Update tree_pass descriptors.
* doc/invoke.texi: Remove documentation of dropped -d? flags.
* tree-into-ssa.c: Update tree_pass descriptors.
* tree-dump.c: Update tree_pass descriptors.
* tree-complex.c: Update tree_pass descriptors.
* tree-dump.h: Update tree_pass descriptors.
* see.c: Update tree_pass descriptors.
* cgraphbuild.c: Update tree_pass descriptors.
* tracer.c: Update tree_pass descriptors.
* tree-loop-distribution.c: Update tree_pass descriptors.
* cgraph.c: Update tree_pass descriptors.
* postreload-gcse.c: Update tree_pass descriptors.
* postreload.c: Update tree_pass descriptors.
* tree-ssa-loop-ch.c: Update tree_pass descriptors.
* tree-tailcall.c: Update tree_pass descriptors.
* tree-pass.h (tree_opt_pass): Rename to ...
(opt_pass) ... this one; add "type" field and remove letter field.
(gimple_opt_pass, rtl_opt_pass, simple_ipa_opt_pass): New.
(execute_pass_list, execute_ipa_pass_list, all_passes, all_ipa_passes,
all_lowering_passes): Update declaration.
* ipa-cp.c: Update tree_pass descriptors.
* final.c: Update tree_pass descriptors.
* omp-low.c: Update tree_pass descriptors.
* tree-ssa-dse.c: Update tree_pass descriptors.
* ipa-reference.c: Update tree_pass descriptors.
* tree-ssa-uncprop.c: Update tree_pass descriptors.
* auto-inc-dec.c: Update tree_pass descriptors.
* reorg.c: Update tree_pass descriptors.
* cgraphunit.c: Update tree_pass descriptors.
* tree-ssa-copyrename.c: Update tree_pass descriptors.
* tree-ssa-ccp.c: Update tree_pass descriptors.
* df-core.c: Update tree_pass descriptors.
* mode-switching.c: Update tree_pass descriptors.
* tree-nomudflap.c: Update tree_pass descriptors.
* modulo-sched.c: Update tree_pass descriptors.
* ipa-pure-const.c: Update tree_pass descriptors.
* cse.c: Update tree_pass descriptors.
* web.c: Update tree_pass descriptors.
* tree-stdarg.c: Update tree_pass descriptors.
* tree-ssa-math-opts.c: Update tree_pass descriptors.
* tree-ssa-dom.c: Update tree_pass descriptors.
* tree-nrv.c: Update tree_pass descriptors.
* tree-ssa-alias.c: Update tree_pass descriptors.
* loop-init.c: Update tree_pass descriptors.
* gimple-low.c: Update tree_pass descriptors.
* ipa-inline.c: Update tree_pass descriptors.
* tree-ssa-sink.c: Update tree_pass descriptors.
* global.c: Update tree_pass descriptors.
* ifcvt.c: Update tree_pass descriptors.
* jump.c: Update tree_pass descriptors.
* predict.c: Update tree_pass descriptors.
* tree-ssa-loop.c: Update tree_pass descriptors.
* recog.c: Update tree_pass descriptors.
* dse.c: Update tree_pass descriptors.
* tree-ssa-ifcombine.c: Update tree_pass descriptors.
* tree-eh.c: Update tree_pass descriptors.
* regmove.c: Update tree_pass descriptors.
* local-alloc.c
* function.c: Update tree_pass descriptors.
* tree-vectorizer.c: Update tree_pass descriptors.
* gcse.c: Update tree_pass descriptors.
* ipa-type-escape.c: Update tree_pass descriptors.
* tree-if-conv.c: Update tree_pass descriptors.
* init-regs.c: Update tree_pass descriptors.
* ipa.c: Update tree_pass descriptors.
* tree-ssa-phiopt.c: Update tree_pass descriptors.
* rtl-factoring.c: Update tree_pass descriptors.
* lower-subreg.c: Update tree_pass descriptors.
* bt-load.c: Update tree_pass descriptors.
* tree-dfa.c: Update tree_pass descriptors.
* except.c: Update tree_pass descriptors.
* emit-rtl.c: Update tree_pass descriptors.
* cfgexpand.c: Update tree_pass descriptors.
* tree-cfgcleanup.c: Update tree_pass descriptors.
* cfgcleanup.c: Update tree_pass descriptors.
* tree-ssa-pre.c: Update tree_pass descriptors.
* tree-sra.c: Update tree_pass descriptors.
* tree-mudflap.c: Update tree_pass descriptors.
* tree-ssa-copy.c: Update tree_pass descriptors.
* cfglayout.c: Update tree_pass descriptors.
* tree-ssa-forwprop.c: Update tree_pass descriptors.
* tree-ssa-dce.c: Update tree_pass descriptors.
* tree-ssa.c: Update tree_pass descriptors.
* regclass.c: Update tree_pass descriptors.
* integrate.c: Update tree_pass descriptors.
* tree-optimize.c: Update tree_pass descriptors.
* tree-ssa-phiprop.c: Update tree_pass descriptors.
* tree-object-size.c: Update tree_pass descriptors.
* combine.c: Update tree_pass descriptors.
* tree-outof-ssa.c: Update tree_pass descriptors.
* bb-reorder.c: Update tree_pass descriptors.
* stack-ptr-mod.c: Update tree_pass descriptors.
* var-tracking.c: Update tree_pass descriptors.
* tree-profile.c: Update tree_pass descriptors.
* tree-vect-generic.c: Update tree_pass descriptors.
* reg-stack.c: Update tree_pass descriptors.
* sched-rgn.c: Update tree_pass descriptors.
* tree-ssa-structalias.c: Update tree_pass descriptors.
* tree-cfg.c: Update tree_pass descriptors.
* passes.c (current_pass): Update declaration.
(finish_optimization_passes): Update.
(all_passes, all_ipa_passes, all_lowering_passes): Update declaration.
(register_one_dump_file, register_dump_files_1, next_pass_1):
Update arguments.
(init_optimization_passes): Update handling of new types.
(execute_one_pass, execute_pass_list, execute_ipa_pass_list): Update.
* ipa-struct-reorg.c: Update tree_pass descriptors.
* tree-ssa-reassoc.c: Update tree_pass descriptors.
* combine-stack-adj.c: Update tree_pass descriptors.
* cfgrtl.c: Update tree_pass descriptors.
* dce.c: Update tree_pass descriptors.
* tree-ssanames.c: Update tree_pass descriptors.
From-SVN: r133342
2008-03-19 12:22:40 +01:00
|
|
|
{
|
2008-05-01 18:08:15 +02:00
|
|
|
IPA_PASS,
|
|
|
|
"inline", /* name */
|
2011-04-17 16:22:20 +02:00
|
|
|
gate_ipa_inline, /* gate */
|
|
|
|
ipa_inline, /* execute */
|
2007-01-16 22:30:54 +01:00
|
|
|
NULL, /* sub */
|
|
|
|
NULL, /* next */
|
|
|
|
0, /* static_pass_number */
|
timevar.def (TV_VARPOOL, [...]): Remove.
* timevar.def (TV_VARPOOL, TV_WHOPR_WPA_LTRANS_EXEC, TV_LIFE,
TV_LIFE_UPDATE, TV_DF_UREC, TV_INLINE_HEURISTICS,
TV_TREE_LINEAR_TRANSFORM, TV_TREE_LOOP_INIT, TV_TREE_LOOP_FINI,
TV_VPT, TV_LOCAL_ALLOC, TV_GLOBAL_ALLOC, TV_SEQABSTR): Remove.
(TV_IPA_INLINING, TV_FLATTEN_INLINING, TV_EARLY_INLINING,
TV_INLINE_PARAMETERS, TV_LOOP_INIT, TV_LOOP_FINI): New.
* timevar.c (timevar_print): Make printing width of timevar names
more flexible, but enforce maximum length.
* ipa-inline.c (pass_early_inline): Use TV_EARLY_INLINING.
(pass_ipa_inline): Use TV_IPA_INLINING.
* ipa-inline-analysis.c (pass_inline_parameters): Use
TV_INLINE_HEURISTICS.
* tree-ssa-loop.c (pass_tree_loop_init): No timevar for wrapper pass.
(pass_tree_loop_done): Likewise.
* final.c (pass_shorten_branches): Use TV_SHORTEN_BRANCH.
* loop-init.c (loop_optimizer_init): Push/pop TV_LOOP_INIT.
(loop_optimizer_finalize): Push/pop TV_LOOP_FINI.
From-SVN: r190409
2012-08-15 10:47:13 +02:00
|
|
|
TV_IPA_INLINING, /* tv_id */
|
2007-01-16 22:30:54 +01:00
|
|
|
0, /* properties_required */
|
2009-04-03 22:15:40 +02:00
|
|
|
0, /* properties_provided */
|
2007-01-16 22:30:54 +01:00
|
|
|
0, /* properties_destroyed */
|
2008-05-01 18:08:15 +02:00
|
|
|
TODO_remove_functions, /* todo_flags_finish */
|
cgraph.c (cgraph_node_name): Remove.
* cgraph.c (cgraph_node_name): Remove.
(dump_cgraph_node): Use dump_symtab_base; reformat.
* cgraph.h (symtab_node_asm_name, symtab_node_name, dump_symtab,
debug_symtab, dump_symtab_node, debug_symtab_node, dump_symtab_base):
Declare.
(cgraph_node_name, varpool_node_name): Remove.
(cgraph_node_asm_name, varpool_node_asm_name,
cgraph_node_name, varpool_node_name): New.
* tree-pass.h (TODO_dump_cgraph): Rename to ...
(TODO_dump_symtab): ... this one.
* ipa-cp (pass_ipa_cp): Update.
* ia-reference.c (generate_summary, read_write_all_from_decl,
propagate, ipa_reference_read_optimization_summary): Update.
* cgraphunit.c (cgraph_analyze_functions): Update.
(cgraph_optimize): Update.
* ipa-ref.c (ipa_dump_references): Update.
(ipa_dump_refering): Update.
* ipa-inline.c (pass_ipa_inline): Update.
* matrix-reorg.c (pass_ipa_matrix_reorg): Update.
* ipa.c (pass_ipa_function_visibility,
pass_ipa_whole_program_visibility): Update.
* tree-sra.c (pass_early_ipa_sra): Update.
* symtab.c: Include langhooks.h
(symtab_node_asm_name): New.
(symtab_node_name): New.
(symtab_type_names): New static var.
(dump_symtab_base): New.
(dump_symtab_node, dump_symtab): New.
(debug_symtab_node, debug_symtab): New.
* tree-ssa-structalias.c: Dump symbol table.
* pases.c (execute_todo): Handle TODO_dump_symtab instead
of TODO_dump_cgraph.
* varpoo.c (varpool_node_name): Remove.
(dump_varpool_node): Use dump_symtab_base; reformat.
From-SVN: r186559
2012-04-18 08:54:33 +02:00
|
|
|
TODO_dump_symtab
|
2010-04-30 00:44:18 +02:00
|
|
|
| TODO_remove_functions | TODO_ggc_collect /* todo_flags_finish */
|
2008-05-01 18:08:15 +02:00
|
|
|
},
|
2008-05-16 00:58:03 +02:00
|
|
|
inline_generate_summary, /* generate_summary */
|
ipa-cp.c (ipcp_write_summary, [...]): New functions.
* ipa-cp.c (ipcp_write_summary, ipcp_read_summary): New functions.
(pass_ipa_cp): Register them.
(ipcp_init_stage): Analyze all functions for whopr/lto.
(ipcp_propagate_stage): Skip external calls.
(ipcp_iterate_stage): Call ipa_update_after_lto_read if needed.
* ipa-reference.c (write_node_summary_p): Fix thinko about availability.
* cgraphunit.c (ipa_passes): When in lto, ne er produce new summaries;
when in ltrans, skip executing of ipa passes since everything should've
been done.
* ipa-inline.c (cgraph_decide_inlining): Remove FIXMEs.
(inline_generate_summary): Likewise.
(inline_read_summary): New function.
(inline_write_summary): New function.
(pass_ipa_inline): Register new hooks.
* ipa-prop.c: Inlcude lto-streamer.h
(ipa_edge_args_vector): Update declaration.
(ipa_count_arguments, ipa_compute_jump_functions,
ipa_free_edge_args_substructures): Move ipa_edge_args_vector into ggc.
(ipa_write_jump_function, ipa_read_jump_function, ipa_write_node_info,
ipa_read_node_info): New static functions.
(ipa_prop_write_jump_functions, ipa_prop_read_jump_functions): Update.
(duplicate_array): Use xmalloc.
(duplicate_ggc_array): New.
(ipa_edge_duplication_hook): Use it.
(ipa_update_after_lto_read): New function.
* ipa-prop.h (ipa_prop_write_jump_functions,
ipa_prop_read_jump_functions): Declare.
(ipa_pass_through_data, ipa_ancestor_jf_data, ipa_member_ptr_cst,
jump_func_value, ipa_member_ptr_cst, ipa_edge_args): Add GTY markers.
(ipa_edge_args_vector): Move into GGC.
(ipa_check_create_edge_args): Update.
(ipa_update_after_lto_read): New.
* passes.c (ipa_write_summaries_1): When in wpa, do not write summaries.
(ipa_read_summaries): When in ltrans, so not read summaries.
* lto-streamer.c (lto_get_section_name): Add LTO_section_jump_functions.
* lto-streamer.h (LTO_section_jump_functions): New section.
(produce_asm): Declare.
* lto-cgraph.c (output_cgraph): Output edges in reverse order.
* lto-streamer-out.c (produce_asm): Export.
* lto-streamer-in.c: Include tree-pass.h
(input_function): Free dominance info when done.
(lto_read_body): Push ipa_inline in ltrans stage.
* gengtype.c (open_base_files): Add ipa-prop.h into includes.
* Makefile.in (GTFILES): Add ipa-prop.h
* lto.c (lto_fixup_jump_functions): New function.
(lto_fixup_decls): Use it.
From-SVN: r153449
2009-10-22 12:02:29 +02:00
|
|
|
inline_write_summary, /* write_summary */
|
|
|
|
inline_read_summary, /* read_summary */
|
2010-04-21 19:44:03 +02:00
|
|
|
NULL, /* write_optimization_summary */
|
|
|
|
NULL, /* read_optimization_summary */
|
2010-04-28 16:05:54 +02:00
|
|
|
NULL, /* stmt_fixup */
|
2008-05-01 18:08:15 +02:00
|
|
|
0, /* TODOs */
|
|
|
|
inline_transform, /* function_transform */
|
|
|
|
NULL, /* variable_transform */
|
Makefile.in (ipa.o, [...]): New files.
* Makefile.in (ipa.o, ipa-inline.o): New files.
* cgraph.h (cgraph_remove_unreachable_nodes, cgraph_postorder,
cgraph_decide_inlining_incrementally, cgraph_clone_inlined_nodes,
cgraph_mark_inline_edge, cgraph_default_inline_p): Declare.
* cgraphunit.c (cgraph_default_inline_p, cgraph_decide_inlining_incrementally,
ncalls_inlined, nfunctions_inlined, initial_insns, overall_insns,
cgraph_estimate_size_after_inlining, cgraph_estimate_growth,
cgraph_clone_inlined_nodes, cgraph_mark_inline_edge,
cgraph_mark_inline, cgraph_check_inline_limits,
cgraph_default_inline_p, cgraph_recursive_inlining_p,
update_callee_keys, lookup_recursive_calls,
cgraph_decide_recursive_inlining, cgraph_set_inline_failed,
cgraph_decide_inlining_of_small_functions, cgraph_decide_inlining,
cgraph_decide_inlining_incrementally, cgraph_gate_inlining,
pass_ipa_inline): Move to ipa-inline.c
(cgraph_postorder, cgraph_remove_unreachable_nodes): Move to ipa.c
* ipa.c: New file.
* ipa-inline.c: New file.
From-SVN: r98548
2005-04-22 10:16:54 +02:00
|
|
|
};
|